[Solved] Session issue : Can't keep it persistent |
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.
sess_save_path has to be the name of your sessions table if you're using the database driver.
I changed the path but still the same.
I try to use native sessions instead and same result.
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') )
I finaly found the solution.
I just reset my cookies configuration and it work again.
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.
He put the cookie configuration back to it's default in the config.php file.
What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
|
Welcome Guest, Not a member yet? Register Sign In |