• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How Can I Extend Session Time

#1
[eluser]mTuran[/eluser]
Hi, in my application users login then i set some variables to session like that:

Code:
$user = array(
   'id' => $user[0]->id,
   'username' => $user[0]->username,
   'fullname' => $user[0]->fullname
);

$this->CI->session->set_userdata($user);

i use ci session library and hold data in database but there is time limit(7200) which is setted in config.php. if user stay page more than 2 hours, user will logout automatically because of session expire. i am waitting your recommendations. Thanks you.

#2
[eluser]Dam1an[/eluser]
If you want the session to last longer, then just increase the time in the config file
Although I think 2 hours of inactivity is more then enough

#3
[eluser]mTuran[/eluser]
i know but if i increase that time session table will be more bigger. Actually i want session not expire while visitor browsing my site but that way(increasing expire time) is most true option i will use that.

Or if my login way wrong what is the true way ? have i to store id variable to anywhere like native PHP session ? I am searching what is the best and true way for do that ? Thanks.

#4
[eluser]Dam1an[/eluser]
[quote author="mTuran" date="1243350955"]Actually i want session not expire while visitor browsing my site but that way(increasing expire time) is most true option i will use that.
[/quote]

Browsing being the key word... if they show NO activity for 2 whole hours, then they're NOT browsing the site
If they browse as you would normally, then the 2 hour timer keep restarting, so they won't get kicked off

#5
[eluser]mTuran[/eluser]
oh god i suppose it expire after 2 hours and if user browsing site, it doensn't restart. Thanks bro.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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