laravel_session值为什么不一样
返回的laravel_session值为什么不一样
位置:vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php
代码调试:
/**
* Add the session cookie to the application response.
*
* @param \Symfony\Component\HttpFoundation\Response $response
* @param \Illuminate\Contracts\Session\Session $session
* @return void
*/
protected function addCookieToResponse(Response $response, Session $session)
{
if ($this->sessionIsPersistent($config = $this->manager->getSessionConfig())) {
var_dump($session->getName(),$session->getId());//这个位置打印响应的cookie值
$response->headers->setCookie(new Cookie(
$session->getName(), $session->getId(), $this->getCookieExpirationDate(),
$config['path'], $config['domain'], $config['secure'] ?? false,
$config['http_only'] ?? true, false, $config['same_site'] ?? null
));
}
}
前台:
是我打印的位置不对吗
推荐文章: