Mercurial > hg > fapweb
comparison msession.inc.php @ 1086:4a95cd4fa341
Check for existence of "expires" field in session data.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Thu, 26 Jan 2017 00:30:58 +0200 |
parents | 48e16e856646 |
children | b2bca5f6d0ff |
comparison
equal
deleted
inserted
replaced
1085:01783161eeb2 | 1086:4a95cd4fa341 |
---|---|
52 { | 52 { |
53 stDebug("Session ".$stype." expires due to expire time not set."); | 53 stDebug("Session ".$stype." expires due to expire time not set."); |
54 stSessionEnd($stype); | 54 stSessionEnd($stype); |
55 return FALSE; | 55 return FALSE; |
56 } | 56 } |
57 | 57 |
58 if ($_SESSION[$stype]["expires"] < time()) | 58 if ($_SESSION[$stype]["expires"] < time()) |
59 { | 59 { |
60 stDebug("Session ".$stype." / ".session_id()." expires due to timeout ".$_SESSION[$stype]["expires"]." < ".time()); | 60 stDebug("Session ".$stype." / ".session_id()." expires due to timeout ".$_SESSION[$stype]["expires"]." < ".time()); |
61 stSessionEnd($stype); | 61 stSessionEnd($stype); |
62 return FALSE; | 62 return FALSE; |
79 if (@session_start() === TRUE && isset($_SESSION)) | 79 if (@session_start() === TRUE && isset($_SESSION)) |
80 { | 80 { |
81 // End current session type | 81 // End current session type |
82 if (isset($_SESSION[$stype])) | 82 if (isset($_SESSION[$stype])) |
83 { | 83 { |
84 stDebug("END session ".$stype." / ".$_SESSION[$stype]["expires"]); | 84 stDebug("END session ".$stype." / ".(isset($_SESSION[$stype]["expires"]) ? $_SESSION[$stype]["expires"] : "?")); |
85 $_SESSION[$stype] = array(); | 85 $_SESSION[$stype] = array(); |
86 unset($_SESSION[$stype]); | 86 unset($_SESSION[$stype]); |
87 $result = TRUE; | 87 $result = TRUE; |
88 } | 88 } |
89 | 89 |