Issue
Though this is the most asked question, none of the solutions worked for me.
Here problem is, session is getting regenerated on every request in my project site on localhost. I'm in db session, where new entry is seen on each request (as well as the cookie), which is not allowing users to login without giving any error.
- There is no problem with
session_start
as I'm using session library. - I tried changing sessions configurations but it doesn't work.
- Other sites on my host are working fine with sessions.
- Working copy of site running on server also giving the same problem in localhost
- I tried to go back to my old version using
git
, that also produces the same problem.
Current config:
$config['sess_driver'] = 'database';
$config['sess_cookie_name'] = '_usr';
$config['sess_expiration'] = 0; // tried changing this
$config['sess_save_path'] = '_sessions_web';
$config['sess_match_ip'] = FALSE;
$config['sess_time_to_update'] = 0; // this too
$config['sess_regenerate_destroy'] = TRUE;
$config['cookie_prefix'] = '';
$config['cookie_domain'] = '';
$config['cookie_path'] = '/';
$config['cookie_secure'] = FALSE;
$config['cookie_httponly'] = FALSE;
Tried adding this too:
ini_set('session.gc_maxlifetime', 30*60); // expires in 30 minutes
Earlier, everything was working fine but looks like this started after upgrading Fedora 25 to 26.
What can be the reason that can cause such problem?
Any help will be appreciated!
Solution
J Shubham!
I just updated the session library with latest one. I have updated these files:
- System/Session/Session.php
- System/Session/Session_driver.php
- System/Session/drivers/Session_files_driver.php
This tricked worked for me on localhost.
Answered By - Zartash Zulfiqar