i am using codeigniter
with ion_auth
configured ,and MySQL as back-end,
my app run smoothly but sometime/not randomly when i call add/update
functions it automatically log me out.
i am working on it for last 1 months but found no solution so far ?
i also change setting in ion_auth
config file.
$config['user_expire'] = 0;
any idea ,solution to this problem?
please comment ,so that i can provide more data if needed.
Note: i have also check this but no luck.
Replace line 346 in system/libraries/Session.php (function sess_update())
With:
hope this works for you .
You are probably performing ajax requests, this is a common issue...
I would suggest you to use session database and make ajax calls is to not update the session...
Make this on you session class
this is best answer.
Create a session library with your own
MY_Session.php
library that overwrote thesess_update
method with one that only executed the update method when not an AJAX request:MY_Session.php
Location of file:
You can either auto-load this library from
config/autoload.php:
Or, you can load it later:
What this sess_update(); does?
In your
system/libraries/Session.php
there is afunction sess_update()
that automatically update your last activity.This function update the session every five minutes by default.