Welcome Guest, Not a member yet? Register   Sign In
I get disconnected randomly from my login session
#1

[eluser]koichirose[/eluser]
Hi, I'm having a weird problem with my codeigniter installation: I get randomly disconnected from my login session, both on my dev server and on my production server.
My dev config:
Code:
$config['sess_cookie_name']  = 'my_session';
$config['sess_expiration']  = 604800; //1 week
$config['sess_expire_on_close'] = FALSE;
$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'] = "";
$config['cookie_domain'] = "";
$config['cookie_path']  = "/";
$config['cookie_secure'] = FALSE;

I guess the config is fine because it works for a while, then I get disconnected and a new session is created on my db. I can't measure the time after which I get disconnected: sometimes within the same day, sometimes I'm logged in for days.

Where should I look to debug my issue?

Thank you
#2

[eluser]CroNiX[/eluser]
I'd remove the underscore from the cookie name. Are you doing anything like making ajax requests? This can happen when the session id (sess_time_to_update) updates within an ajax request.
#3

[eluser]koichirose[/eluser]
I am making ajax requests all around the site.
I just removed the underscore, let's see if this works.

Thank you!
#4

[eluser]InsiteFX[/eluser]
Also make sure you are using the newest ci_session table.
#5

[eluser]koichirose[/eluser]
Hello. Sorry to bring this up again, I still get randomly disconnected (twice in a day today, sometimes I go on for weeks without getting disconnected).
I removed the underscore (the session is now called 'mysession').

I really don't know where to look.

Thanks again.
#6

[eluser]pedsa[/eluser]
Hello Koichirose,
thanks for opening this discussion. I'm new in CodeIgniter and I've the same problem with CI 2.1.2 Session.
Right now I'm not using Ajax and the problem still remains.
I already analyze some session code and I realize that the "last_activity" field does not update when I perform some activity in the session (eg. $this->session->set_userdata($array) ). This is normal? I asking this because this field is the one that is compared in the Session class of the CI core.
#7

[eluser]pedsa[/eluser]
[quote author="koichirose" date="1337792051"]Hi, I'm having a weird problem with my codeigniter installation: I get randomly disconnected from my login session, both on my dev server and on my production server.
My dev config:
Code:
$config['sess_cookie_name']  = 'my_session';
$config['sess_expiration']  = 604800; //1 week
$config['sess_expire_on_close'] = FALSE;
$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'] = "";
$config['cookie_domain'] = "";
$config['cookie_path']  = "/";
$config['cookie_secure'] = FALSE;

I guess the config is fine because it works for a while, then I get disconnected and a new session is created on my db. I can't measure the time after which I get disconnected: sometimes within the same day, sometimes I'm logged in for days.

Where should I look to debug my issue?

Thank you[/quote]

Koichirose do you already solved this problem? I still can not solve the problem...

Thanks
#8

[eluser]koichirose[/eluser]
No, I didn't...hoping for someone to help us!
#9

[eluser]SPeed_FANat1c[/eluser]
this problem is from CI 1.7.2 time Smile o maybe earlier, but I didn't use it earlier yet
#10

[eluser]koichirose[/eluser]
Apparently it's not been solved for me Sad
I still need hints on how to debug this!

Thanks




Theme © iAndrew 2016 - Forum software by © MyBB