• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Sudden change of the Session Ids

#1
[eluser]mDonchev[/eluser]
Hi Guys,

I have a really strange problems with the sessions on an intranet project I did with CodeIgniter 1.7.3.

I have my sessions stored in the database and the project is in a subfolder of my domain.
This is a fraction of my config.php file:

Code:
$config['sess_cookie_name']        = 'ci_session';
$config['sess_expiration']        = 0;
$config['sess_encrypt_cookie']    = FALSE;
$config['sess_use_database']    = TRUE;
$config['sess_table_name']        = 'ci_sessions';
$config['sess_match_ip']        = FALSE;
$config['sess_match_useragent']    = TRUE;
$config['sess_time_to_update']     = 300;

/*
...
*/

$config['cookie_prefix']    = "ace_";
$config['cookie_domain']    = ".mydomain.com";
$config['cookie_path']        = "/ACE/";

The problem:
From time to time (so far I cannot tell why or see any logic in this) the session variable of the logged user is being changed and so all the session information is lost and no user_id no nothing => the user gets the login screen (thats a logic I built in situations like this /no session info/)

Any idea what may cause the session_id change during the work with the project.
Its mainly Ajax based but I don't see any problem with this.

Any help will be highly appreciated.

Thanks in advance
Martin

#2
[eluser]WanWizard[/eluser]
CI's sessions are not AJAX proof, if you happen to be processing an AJAX call when the session library rotates the session ID, you lose the session on the next page request.

Search for 'is_ajax' and 'sess_update' to find a way around it, this has been discussed a zillion times...


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.