Changeset 1637
- Timestamp:
- 12/28/2007 12:41:16 PM (11 months ago)
- Files:
-
- 1 modified
-
trunk/system/libraries/Session.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/system/libraries/Session.php
r1619 r1637 10 10 class Session_Core { 11 11 12 // Number of instances of Session object13 private static $instance s = 0;12 // Session singleton 13 private static $instance; 14 14 15 15 // Protected key names (cannot be set by the user) … … 27 27 28 28 /** 29 * Singleton instance of Session. 30 */ 31 public static function instance() 32 { 33 // Create the instance if it does not exist 34 empty(self::$instance) and new Session; 35 36 return self::$instance; 37 } 38 39 /** 29 40 * Constructor: __construct 30 41 * On first session instance creation, sets up the driver and creates session. … … 35 46 36 47 // This part only needs to be run once 37 if (self::$instance s === 0)48 if (self::$instance === NULL) 38 49 { 39 50 // Load config … … 78 89 // the session cookie can be written 79 90 Event::add('system.send_headers', 'session_write_close'); 80 } 81 82 // New instance83 self::$instances += 1;91 92 // Singleton instance 93 self::$instance = $this; 94 } 84 95 85 96 Log::add('debug', 'Session Library initialized'); … … 133 144 if ( ! isset($_SESSION['_kf_flash_'])) 134 145 { 135 $_SESSION['user_agent'] = $this->input->user_agent();146 $_SESSION['user_agent'] = Kohana::$user_agent; 136 147 $_SESSION['ip_address'] = $this->input->ip_address(); 137 148 $_SESSION['_kf_flash_'] = array();
