Does session_start in PHP prevent session expiration? -


i'm bewildered using session_start in php. should use in scripts both when user creates session , when resumes on consequent queries - or when creating?

currently not call when session exists have found session expires unexpectedly fast:

for example, public log of site see:

srinivasvarma678 09:14:34 27-jun-14     i've logged in...  ...  srinivasvarma678 08:59:38 27-jun-14     i'm proud tell i've solved vowel count! 

i.e. user's last interaction site @ 8:59 , in 15 minutes needs log in again (though session.gc_maxlifetime=1440)

could behavior explained fact not calling session_start every time?

short answer: yes

as stated here in php docs:

session_start() creates session or resumes current 1 based on  session identifier passed via or post request, or passed via cookie. 

so if want continue session, should use session_start() on every page...


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -