aboutsummaryrefslogtreecommitdiffhomepage
path: root/inc/3rdparty/Session.class.php
diff options
context:
space:
mode:
authorNicolas LÅ“uillet <nicolas.loeuillet@gmail.com>2013-12-23 02:28:56 -0800
committerNicolas LÅ“uillet <nicolas.loeuillet@gmail.com>2013-12-23 02:28:56 -0800
commit60fc4f4b1ab37fbfe9021f3fa1395d66a4424ed2 (patch)
tree515c4b9c8286ae363f77722c91acb878151dc386 /inc/3rdparty/Session.class.php
parentcbfd5a1019f47fadefd8490dae9f039ae894298d (diff)
parentda5fc42f615eeb45a702604970f94967507fb432 (diff)
downloadwallabag-1.3.0.tar.gz
wallabag-1.3.0.tar.zst
wallabag-1.3.0.zip
Merge pull request #363 from inthepoche/dev1.3.0
poche 1.3.0
Diffstat (limited to 'inc/3rdparty/Session.class.php')
-rw-r--r--inc/3rdparty/Session.class.php11
1 files changed, 9 insertions, 2 deletions
diff --git a/inc/3rdparty/Session.class.php b/inc/3rdparty/Session.class.php
index df913a06..32624559 100644
--- a/inc/3rdparty/Session.class.php
+++ b/inc/3rdparty/Session.class.php
@@ -32,6 +32,8 @@ class Session
32 // If the user does not access any page within this time, 32 // If the user does not access any page within this time,
33 // his/her session is considered expired (3600 sec. = 1 hour) 33 // his/her session is considered expired (3600 sec. = 1 hour)
34 public static $inactivityTimeout = 3600; 34 public static $inactivityTimeout = 3600;
35 // Extra timeout for long sessions (if enabled) (82800 sec. = 23 hours)
36 public static $longSessionTimeout = 82800;
35 // If you get disconnected often or if your IP address changes often. 37 // If you get disconnected often or if your IP address changes often.
36 // Let you disable session cookie hijacking protection 38 // Let you disable session cookie hijacking protection
37 public static $disableSessionProtection = false; 39 public static $disableSessionProtection = false;
@@ -106,6 +108,7 @@ class Session
106 $password, 108 $password,
107 $loginTest, 109 $loginTest,
108 $passwordTest, 110 $passwordTest,
111 $longlastingsession,
109 $pValues = array()) 112 $pValues = array())
110 { 113 {
111 self::banInit(); 114 self::banInit();
@@ -118,7 +121,11 @@ class Session
118 $_SESSION['username'] = $login; 121 $_SESSION['username'] = $login;
119 // Set session expiration. 122 // Set session expiration.
120 $_SESSION['expires_on'] = time() + self::$inactivityTimeout; 123 $_SESSION['expires_on'] = time() + self::$inactivityTimeout;
121 124 if ($longlastingsession) {
125 $_SESSION['longlastingsession'] = self::$longSessionTimeout;
126 $_SESSION['expires_on'] += $_SESSION['longlastingsession'];
127 }
128
122 foreach ($pValues as $key => $value) { 129 foreach ($pValues as $key => $value) {
123 $_SESSION[$key] = $value; 130 $_SESSION[$key] = $value;
124 } 131 }
@@ -136,7 +143,7 @@ class Session
136 */ 143 */
137 public static function logout() 144 public static function logout()
138 { 145 {
139 unset($_SESSION['uid'],$_SESSION['ip'],$_SESSION['expires_on'],$_SESSION['tokens'], $_SESSION['login'], $_SESSION['pass'], $_SESSION['poche_user']); 146 unset($_SESSION['uid'],$_SESSION['ip'],$_SESSION['expires_on'],$_SESSION['tokens'], $_SESSION['login'], $_SESSION['pass'], $_SESSION['longlastingsession'], $_SESSION['poche_user']);
140 } 147 }
141 148
142 /** 149 /**