![]() |
[Solved] Session issue : Can't keep it persistent - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Development (https://forum.codeigniter.com/forumdisplay.php?fid=6) +--- Forum: CodeIgniter 3.x (https://forum.codeigniter.com/forumdisplay.php?fid=17) +--- Thread: [Solved] Session issue : Can't keep it persistent (/showthread.php?tid=66898) |
[Solved] Session issue : Can't keep it persistent - Jurden - 12-15-2016 Hello, I don't know why but I lose my session at any refresh. I try to store it by file and now in my database. Here it's the only thing I have when i refresh my page (anytime different) : PHP Code: Array This is my current config : AUTOLOAD PHP Code: $autoload['libraries'] = array( 'database', 'session' ); CONFIG PHP Code: $config['sess_driver'] = 'database'; MODEL PHP Code: public function createSession(){ If you have any ideas... Thank you. RE: Session issue : Can't keep it persistent - skunkbad - 12-15-2016 sess_save_path has to be the name of your sessions table if you're using the database driver. RE: Session issue : Can't keep it persistent - Jurden - 12-16-2016 I changed the path but still the same. I try to use native sessions instead and same result. RE: Session issue : Can't keep it persistent - skunkbad - 12-16-2016 Another thing is that null ever will be == null. Instead you would use: PHP Code: if( is_null( get_cookie('watch_dog') ) ) PHP Code: if( get_cookie('watch_dog') ) RE: Session issue : Can't keep it persistent - Jurden - 12-19-2016 Well noticed. I'll keep looking on that issue. RE: Session issue : Can't keep it persistent - Jurden - 12-22-2016 I finaly found the solution. I just reset my cookies configuration and it work again. RE: [Solved] Session issue : Can't keep it persistent - derena - 03-15-2017 I have a problem like this. Everytime when i refresh the page, it creates a new session. What should i do? $config['sess_driver'] = 'database'; $config['sess_cookie_name'] = 'pbsession'; $config['sess_expiration'] = 7200; $config['sess_save_path'] = 'pbsession'; $config['sess_match_ip'] = FALSE; $config['sess_time_to_update'] = 300; $config['sess_regenerate_destroy'] = TRUE; ---- $config['cookie_prefix'] = ''; $config['cookie_domain'] = ''; $config['cookie_path'] = '/'; $config['cookie_secure'] = FALSE; $config['cookie_httponly'] = FALSE; I use PHP 7.1.2, IIS 7 and Codeigniter 3.1 on Windows Server 2008 R2. RE: Session issue : Can't keep it persistent - jvandemerwe - 05-09-2017 (12-22-2016, 01:19 AM)Jurden Wrote: I finaly found the solution. What does that mean? How do you reset this? It would be nice if you could elaborate on this a bit more. RE: [Solved] Session issue : Can't keep it persistent - InsiteFX - 05-10-2017 He put the cookie configuration back to it's default in the config.php file. RE: [Solved] Session issue : Can't keep it persistent - Jurden - 05-11-2017 Correct ![]() |