本文整理汇总了PHP中Illuminate\Session\Store::start方法的典型用法代码示例。如果您正苦于以下问题:PHP Store::start方法的具体用法?PHP Store::start怎么用?PHP Store::start使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Session\Store
的用法示例。
在下文中一共展示了Store::start方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: dispatch
protected function dispatch()
{
$name = $this->getName();
if (isset($_COOKIE[$name]) && ($sessionId = $_COOKIE[$name])) {
$this->setId($sessionId);
} else {
if (!isset($_COOKIE[$name])) {
setcookie($name, $this->getId(), time() + 60 * $this->config['lifetime'], $this->config['path'], $this->config['domain'], $this->config['secure'], $this->config['http_only']);
}
}
parent::start();
register_shutdown_function([$this, 'save']);
}
示例2: validateCredential
/**
* Called by workerman application<br>
* 检验凭证。 参数是凭证数据。如果检验通过,请返回用户ID;否则返回false
* @param $credential
* @return bool|integer
*/
public function validateCredential($credential)
{
list($sessionId, $token) = $credential;
$sessionId = \Crypt::decrypt($sessionId);
$token = \Crypt::decrypt($token);
$sessStore = new Store($sessionId, \App::make('session')->driver()->getHandler(), $sessionId);
$sessStore->start();
if ($sessStore->has($this->tokenKey)) {
if ($sessStore->get($this->tokenKey) == $token) {
$sessStore->remove($this->tokenKey);
$userIdKey = 'login_' . md5('Illuminate\\Auth\\Guard');
$userId = $sessStore->get($userIdKey);
return $userId;
}
}
return false;
}
示例3: start
/**
* Starts the session storage.
*
* @return bool True if session started.
* @throws \RuntimeException If session fails to start.
* @static
*/
public static function start()
{
return \Illuminate\Session\Store::start();
}
示例4: start
/**
* {@inheritdoc}
*/
public function start()
{
$this->store->start();
return $this;
}
示例5: createStorage
protected function createStorage($sessionId = null)
{
if ($sessionId !== null) {
// $name = '/Google_Client';
// $path = session_save_path().'/'.$name;
$name = 'Recca0120Socialite';
$path = sys_get_temp_dir() . '/' . $name;
$sessionId = sha1(serialize($sessionId));
$file = new Filesystem();
if ($file->isDirectory($path) === false) {
$file->makeDirectory($path, 0755, true);
}
$handler = new FileSessionHandler($file, $path);
$session = new LaravelSession($name, $handler, $sessionId);
// $handler = new SymfonyFileHandler($path);
// $session = new SymfonySession($handler);
$session->setId($sessionId);
$session->start();
$this->saveSessionWhenShutdown($session);
} else {
$session = static::$session;
if ($session === null) {
$session = $this->request->getSession();
if ($session === null) {
if (session_status() == PHP_SESSION_NONE) {
$handler = new SymfonyNativeSessionHandler();
} else {
$handler = new SymfonyPhpBridgeSessionHandler();
}
$session = new SymfonySession($handler);
$session->start();
$this->saveSessionWhenShutdown($session);
}
static::$session = $session;
}
}
$storage = new Storage($session);
return $storage;
}
示例6: let
function let(Store $session)
{
$session->start();
$this->beConstructedWith($session);
}