Session is created everytime I refresh my browser. - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Session is created everytime I refresh my browser. (/showthread.php?tid=53085) |
Session is created everytime I refresh my browser. - El Forum - 07-10-2012 [eluser]jpganz[/eluser] Hi! I am trying to use session on codeigniter but I am getting an error, everytime I refresh my page seems like CI creates another session, and of course I cant save my info. Any idea why is this? how could I solve it? My code is this Code: $this->load->library('session'); And my configuration (because I read this could cause the problem) is this Code: $config['sess_cookie_name'] = 'site'; Any help would be greatful appreciated. Session is created everytime I refresh my browser. - El Forum - 07-11-2012 [eluser]LuckyFella73[/eluser] Try this: Code: $config['cookie_prefix'] = ""; I prefer to save session data in DB - youcould try that too. Be sure to set up the table the right way. Older versions from user guide had some issues (not enough chars for user agent) Template for session table: Code: DROP TABLE IF EXISTS `ci_sessions`; EDIT: you should encrypt you session data btw |