Example #1
0
 /**
  * Pseudo constructor.
  *
  * @param string $base The base path for the Session
  * @return void
  */
 public static function init($base = null)
 {
     self::$time = time();
     $checkAgent = Configure::read('Session.checkAgent');
     if (($checkAgent === true || $checkAgent === null) && env('HTTP_USER_AGENT') != null) {
         self::$_userAgent = md5(env('HTTP_USER_AGENT') . Configure::read('Security.salt'));
     }
     self::_setPath($base);
     self::_setHost(env('HTTP_HOST'));
     register_shutdown_function('session_write_close');
 }
 /**
  * Pseudo constructor.
  *
  * @param string $base The base path for the Session
  * @return void
  */
 public static function init($base = null)
 {
     self::$time = time();
     if (env('HTTP_USER_AGENT')) {
         self::$_userAgent = md5(env('HTTP_USER_AGENT') . Configure::read('Security.salt'));
     }
     self::_setPath($base);
     self::_setHost(env('HTTP_HOST'));
     if (!self::$_initialized) {
         register_shutdown_function('session_write_close');
     }
     self::$_initialized = true;
 }
 /**
  * Constructor.
  *
  * @param string $base The base path for the Session
  * @param boolean $start Should session be started right now
  */
 public static function init($base = null, $start = true)
 {
     App::import('Core', 'Security');
     self::$time = time();
     $checkAgent = Configure::read('Session.checkAgent');
     if (($checkAgent === true || $checkAgent === null) && env('HTTP_USER_AGENT') != null) {
         self::$_userAgent = md5(env('HTTP_USER_AGENT') . Configure::read('Security.salt'));
     }
     self::_setPath($base);
     self::_setHost(env('HTTP_HOST'));
 }