+ 6

[Solved] How to set to expire session automatically in given time , in session creation time?

Php session

9th May 2020, 5:54 AM
Gaurav Dixit🇮🇳
Gaurav Dixit🇮🇳 - avatar
4 Réponses
+ 6
I found this on StackOverflow: if (!isset($_SESSION['CREATED'])){ $_SESSION['CREATED'] = time(); } else if (time()-$_SESSION['CREATED'] > time_in_seconds){ //handle code for what happens } https://stackoverflow.com/questions/520237/how-do-i-expire-a-php-session-after-30-minutes?r=SearchResults
9th May 2020, 6:06 AM
👑 Prometheus 🇸🇬
👑 Prometheus 🇸🇬 - avatar
9th May 2020, 6:01 AM
Gordon
Gordon - avatar
+ 1
https://code.sololearn.com/wa103a4A1a7A/?ref=app
20th Jun 2021, 2:59 AM
Gaurav Dixit🇮🇳
Gaurav Dixit🇮🇳 - avatar
0
You should implement a session timeout using session.gc_maxlifetime option.
11th May 2020, 5:46 PM
Lokesh Gupta
Lokesh Gupta - avatar