Changeset 2649

Show
Ignore:
Timestamp:
05/07/08 06:24:24 (3 months ago)
Author:
armen
Message:

Fixed a bug which prevents cleanuping destroied session from database.
This bug happens when the Session::destroy executed after Session::regenerate in a request.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/system/libraries/Session.php

    r2627 r2649  
    250250                if (isset($_SESSION)) 
    251251                { 
     252                        // Destroy the session 
     253                        session_destroy(); 
     254 
    252255                        // Remove all session data 
    253256                        session_unset(); 
     
    255258                        // Delete the session cookie 
    256259                        cookie::delete(self::$config['name']); 
    257  
    258                         // Destroy the session 
    259                         session_destroy(); 
    260260 
    261261                        // Re-initialize the array 
  • trunk/system/libraries/drivers/Session/Database.php

    r2009 r2649  
    125125        public function destroy($id) 
    126126        { 
     127                $config = Config::item('session'); 
     128 
     129        ($config['regenerate'] > 0 AND ($_SESSION['total_hits'] % $config['regenerate']) === 0) AND $id = $this->old_id; 
     130         
    127131                return (bool) $this->db->delete($this->db_group, array('session_id' => $id))->count(); 
    128132        }