Changeset 9973

Show
Ignore:
Timestamp:
11/18/08 21:05:00 (2 months ago)
Author:
afz
Message:

full optimize delete expired session

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/0.8/jaws/html/include/Jaws/Session.php

    r9972 r9973  
    119119        include_once JAWS_PATH . 'include/Jaws/Session/Cache.php'; 
    120120        $this->_cache = new Jaws_Session_Cache; 
     121 
     122        // Delete expired sessions 
     123        $last_expired_file = JAWS_DATA . 'last_expired'; 
     124        $last_expired = @file_get_contents($last_expired_file); 
     125        if ($last_expired === false ||  
     126           ($last_expired < (time() - ($GLOBALS['app']->Registry->Get('/policy/session_idle_timeout') * 60)))) 
     127        { 
     128            Jaws_Utils::file_put_contents($last_expired_file, time()); 
     129            $this->_cache->DeleteExpiredSessions(); 
     130        } 
    121131    } 
    122132 
     
    333343        $this->SetAttribute('groups', $groups); 
    334344 
    335         // Delete expired sessions 
    336         $this->_cache->DeleteExpiredSessions(); 
    337  
    338345        if ($this->Synchronize()) { 
    339346            return true; 
  • branches/0.8/jaws/html/include/Jaws/Session/Web.php

    r9972 r9973  
    2828    function init() 
    2929    { 
    30         if ($GLOBALS['app']->IsAgentRobot()) { 
    31             $this->_Logged = false; 
    32         } else { 
    33         } 
    34  
    3530        $session = $this->GetCookie(JAWS_SESSION_ID); 
    3631        if ($session === false || !$this->Load($session)) {