cookies - php keep session alive for multiple days -
i have app enable users choose stay logged in long period of time, 3 days similar google mail, facebook or linkedin. (it meant accessed phone , data far less sensitive other stuff on phone.) right setting 4 session variables on log in, such id of user, name, etc. avoid lot of recoding , lost functionality, i'd of these variables remain accessible.
is there way increase session length 72 hours when setting session variables?
alternatively, if need set cookies, best practice achieve long logged in time when there number of session variables set.
thanks.
you can set session various ways. 1 of ways set in php.ini
session.gc_maxlifetime = 360*72
with php can with
ini_set(’session.gc_maxlifetime’, 360*72);
you can use
session_set_cookie_params(360*72,"/");
http://pl1.php.net/session_set_cookie_params
it sets session cookie. can serialize $_session , set in cookie.
Comments
Post a Comment