Changeset 10050
- Timestamp:
- 11/29/08 18:36:01 (1 month ago)
- Files:
-
- trunk/jaws/html/include/Jaws/Session/Cache.php (modified) (1 diff)
- trunk/jaws/html/include/Jaws/Session/Web.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/jaws/html/include/Jaws/Session/Cache.php
r9990 r10050 217 217 function GetSession($sid) 218 218 { 219 $params = array();219 $params = array(); 220 220 $params['sid'] = $sid; 221 221 222 222 $sql = ' 223 SELECT [session_id], [user_id], [hash], [md5] 224 FROM [[session]] 225 WHERE [session_id] = {sid}'; 223 SELECT 224 [session_id], [user_id], [hash], [md5], [updatetime], [life_time] 225 FROM [[session]] 226 WHERE 227 [session_id] = {sid}'; 226 228 227 229 $result = $GLOBALS['db']->queryRow($sql, $params); 228 if (Jaws_Error::isError($result) || !isset($result['session_id'])) { 229 return false; 230 } 231 232 return $result; 230 if (!Jaws_Error::isError($result) && isset($result['session_id'])) { 231 $expired = time() - ($GLOBALS['app']->Registry->Get('Session/idle_timeout') * 60); 232 if ($result['updatetime'] >= ($expired - $result['life_time'])) { 233 return $result; 234 } 235 } 236 237 return false; 233 238 } 234 239 trunk/jaws/html/include/Jaws/Session/Web.php
r9990 r10050 28 28 function init() 29 29 { 30 $session_id = $this->GetCookie(JAWS_SESSION_ID); 31 if ($session_id === false || !$this->Load($session_id)) { 32 if ($this->Create('', false) && $this->Load($this->_SessionID)) { 33 $session_id = $this->_SessionID; 34 } else { 35 $session_id = false; 36 } 37 } 38 39 if ($session_id) { 30 $session = $this->GetCookie(JAWS_SESSION_ID); 31 if ($session === false || !$this->Load($session)) { 32 $this->Create(''); 33 $this->_Logged = false; 34 } else { 40 35 $this->_Logged = $this->GetAttribute('logged'); 41 } else {42 $this->_Logged = false;43 36 } 44 37 } … … 83 76 $version = $GLOBALS['app']->Registry->Get('Session/cookie_version'); 84 77 $name = $name.'_'.md5($GLOBALS['app']->getSiteURL().'_'.$version); 85 setcookie($name, $value, ( ($minutes ==0)? 0 : time() +(60 * $minutes)), $GLOBALS['app']->getSiteURL(true, true) . '/');78 setcookie($name, $value, ($minutes == 0)? 0 : (time() + $minutes*60), $GLOBALS['app']->getSiteURL(true, true) . '/'); 86 79 } 87 80
