PHP Session Lifespan
So I ran into an interesting comment left on the manual page for session_cache_expire.
...
The garbage collector controls the session data and destroys sessions which are older then 1440 seconds (24 minutes) by default.
So to keep a session alive longer then 24 minutes (for example when a visitor tries to POST a huge message that took him 1 hour to type), you must modify the session.gc_maxlifetime thru ini_set()
Somehow i couldn't find anything in the PHP documentation regarding this and due to that me (and i think many others) got the wrong ideas regarding PHP sessions.
A few examples to fix session timeout are already posted below but in my opinion they all missed session.gc_maxlifetime
To say that people may be missing this may be an understatement.
