• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
I get disconnected randomly from my login session

#21
[eluser]qcsites[/eluser]
Do you have more than one ci site on the server? you may need to add a cookie prefix to avoid collisions and/or use unique cookie names.

ci site 1
Session Variables
$config['sess_cookie_name'] = 'cione';
Cookie Variables
$config['cookie_prefix'] = "appone";

ci site 2
Session Variables
$config['sess_cookie_name'] = 'citwo';
Cookie Variables
$config['cookie_prefix'] = "apptwo";

#22
[eluser]SPeed_FANat1c[/eluser]
[quote author="XPerez" date="1347963083"]I had this problem also, and I discovered that the problem was originated by ajax calls, due to a different agent name. Seems that Firefox adds 'ajax' at bottom when detects ajax call, and other browsers make the same.

My solution is to set 'match_useragent' to FALSE.

[/quote]

This I think would not solve the problem. Because we have made that for ajax request it should not update the session anywway. And I have added logging in the if block where it does not match useragent, and log only my requests (not other users), but there are only few such cases, maybe when I login from different browser, don't know.

Quote:Do you have more than one ci site on the server?
I have made some small websites, which were only ones at the server, still was getting disconects.

#23
[eluser]n1colius[/eluser]
i am also having the same problem..
i just have to clear the ci_sessions table to make it work normally again..
but sometimes it just randomly disappear again..
weird..

so there are no solution yet for this problem?

#24
[eluser]keevitaja[/eluser]
is this problem occurring with a auth system where logged in users are stored in a sepparate mysql table and session identifier is CI session_id hash?

#25
[eluser]koichirose[/eluser]
keevitaja, if I understand what you asked correctly:
I save my users in a "users" table, my session in "ci_sessions".
There are no references between this two tables at all.

#26
[eluser]keevitaja[/eluser]
how does the auth system know, if user is logged in? you must store this information somewhere...

or you keep users id in session data?

#27
[eluser]koichirose[/eluser]
I keep my user id in the session data.
Here's my login function:
Code:
function save_session($user) {
  $session_data = array (
   'userid' => $user->user_id,
   'user_first_name' => $user->first_name,
  );
  $this->ci->session->set_userdata($session_data);
    }

The non logged in users also get some session data (which country they're in, the language, etc). Then if they login I call this one.

#28
[eluser]keevitaja[/eluser]
sorry, i thought maybe problem is in updated session_id hash, but in your case it clearly is not.

#29
[eluser]Unknown[/eluser]
I just don't know how to solve this problem.
Is anyone have a solution? Or simply is anyone know the cause or how to reproduce the bug?
It would be great..

#30
[eluser]TheFuzzy0ne[/eluser]
Well since you're out of ideas, perhaps you should try setting $config['match_user_agent'] to FALSE, to see if it makes any difference. Failing that, the problem is most likely to do with your authorisation system, so I would suggest you debug that.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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