Session overwriting Session of another system - 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 overwriting Session of another system (/showthread.php?tid=50917) |
Session overwriting Session of another system - El Forum - 04-13-2012 [eluser]soprabaixar1[/eluser] I have two systems I use CodeIgniter, but when I log into one it overwrites the data in the other session. I thought it could be config "sess_cookie_name", then changed one of them and did the test again, but it still fails. Code: $this->session->sess_destroy(); Session overwriting Session of another system - El Forum - 04-13-2012 [eluser]soprabaixar1[/eluser] Found a solution. Instead of using the code below: Code: $data = array( Use it at the beginning: Code: $this->config->set_item('sess_cookie_name', 'session_system_1'); Session overwriting Session of another system - El Forum - 04-13-2012 [eluser]soprabaixar1[/eluser] I was wrong, I did the wrong test ... the error persists. Session overwriting Session of another system - El Forum - 04-13-2012 [eluser]soprabaixar1[/eluser] The two projects use CodeIgniter and are sharing the session. I do not want to share the session. http://ellislab.com/codeigniter/user-guide/libraries/sessions.html Session overwriting Session of another system - El Forum - 04-13-2012 [eluser]soprabaixar1[/eluser] Anybody? Session overwriting Session of another system - El Forum - 04-13-2012 [eluser]Samus[/eluser] why not just change the session cookie name per application? You can do that in application/config/config.php Code: $config['sess_cookie_name'] = 'ci_session'; // change this to something else Session overwriting Session of another system - El Forum - 04-13-2012 [eluser]soprabaixar1[/eluser] Thanks, it worked. I do not understand why I can change some config session doing this: Code: $this->session->sess_expiration = 10800; // 3h But when I try to do the same for "sess_cookie_name" does not work. Session overwriting Session of another system - El Forum - 04-13-2012 [eluser]Samus[/eluser] [quote author="soprabaixar1" date="1334354056"]Thanks, it worked. I do not understand why I can change some config session doing this: Code: $this->session->sess_expiration = 10800; // 3h But when I try to do the same for "sess_cookie_name" does not work.[/quote] Well I just changed my $config['log_threshold'] = 3; to display informational messages only and I noticed that the session class is initialized before the controller class. So that may be where your problem lies Quote:DEBUG - 2012-04-13 21:59:07 --> Config Class Initialized |