Changeset 2993
- Timestamp:
- 07/07/2008 08:27:40 PM (5 months ago)
- Files:
-
- 1 modified
-
trunk/system/libraries/Session.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/system/libraries/Session.php
r2919 r2993 78 78 Event::add('system.send_headers', array($this, 'write_close')); 79 79 80 // Make sure that sessions are closed before exiting 81 register_shutdown_function(array($this, 'write_close')); 82 80 83 // Singleton instance 81 84 self::$instance = $this; … … 103 106 public function create($vars = NULL) 104 107 { 105 // Destroy any current ly running session108 // Destroy any current sessions 106 109 $this->destroy(); 107 110 … … 246 249 if (isset($_COOKIE[$name])) 247 250 { 248 // Change the cookie value to match the new session id to remove the "lag time"251 // Change the cookie value to match the new session id to prevent "lag" 249 252 $_COOKIE[$name] = $_SESSION['session_id']; 250 253 } … … 258 261 public function destroy() 259 262 { 260 if (isset($_SESSION)) 261 { 263 if (session_id() !== '') 264 { 265 // Get the session name 266 $name = session_name(); 267 262 268 // Destroy the session 263 269 session_destroy(); 264 270 265 // Remove all session data266 session_unset();267 268 // Delete the session cookie269 cookie::delete(self::$config['name']);270 271 271 // Re-initialize the array 272 272 $_SESSION = array(); 273 274 // Delete the session cookie 275 cookie::delete($name); 273 276 } 274 277 }
