...
|
...
|
@@ -47,7 +47,7 @@ class CacheSession extends Root implements SessionHandlerInterface |
|
|
/**
|
|
|
* 初始化
|
|
|
*/
|
|
|
public function __construct()
|
|
|
public function __construct($sessionName = null, $domain = null)
|
|
|
{
|
|
|
session_set_save_handler(
|
|
|
array(&$this, "open"),
|
...
|
...
|
@@ -60,8 +60,14 @@ class CacheSession extends Root implements SessionHandlerInterface |
|
|
if (version_compare(phpversion(), '5.4.0', '>=')) {
|
|
|
register_shutdown_function('session_write_close');
|
|
|
}
|
|
|
if ($sessionName != null && is_string($sessionName) && strlen($sessionName) > 1) {
|
|
|
ini_set("session.name", $sessionName);
|
|
|
}
|
|
|
ini_set("session.use_cookies", 1);
|
|
|
ini_set("session.cookie_domain", ".yohobuy.com");
|
|
|
ini_set('use_only_cookies', 0);
|
|
|
if ($domain != null) {
|
|
|
ini_set("session.cookie_domain", '.' . $domain);
|
|
|
}
|
|
|
ini_set('session.cookie_path', '/');
|
|
|
ini_set('session.gc_maxlifetime', $this->gcMaxLifeTime);
|
|
|
}
|
...
|
...
|
@@ -145,7 +151,6 @@ class CacheSession extends Root implements SessionHandlerInterface |
|
|
public function write($sessionID, $sessionData)
|
|
|
{
|
|
|
$return = $this->cache()->set($this->sessionPrefix . $sessionID, $sessionData, $this->gcMaxLifeTime);
|
|
|
var_dump($return);exit;
|
|
|
return $return;
|
|
|
}
|
|
|
|
...
|
...
|
|