-
Notifications
You must be signed in to change notification settings - Fork 11
Session destroy #29
Comments
The other way around:
|
@froschdesign thank you for quickly responding. I thought about it, but then there is another problem. Suppose a user visits the site: And after doing logout. Code exmple: public function handle(ServerRequestInterface $request): ResponseInterface
{
/** @var LazySession $session */
$session = $request->getAttribute(SessionMiddleware::SESSION_ATTRIBUTE);
$session->clear();
return new RedirectResponse($this->urlHelper->generate('home'), ResponseInfo::HTTP_FOUND);
} Please note that a new session is not created. The user continues to visit the site with the same session after the logout. I think it is incorrect. So: public function handle(ServerRequestInterface $request): ResponseInterface
{
/** @var LazySession $session */
$session = $request->getAttribute(SessionMiddleware::SESSION_ATTRIBUTE);
$session->clear();
$session->regenerate();
return new RedirectResponse($this->urlHelper->generate('home'), ResponseInfo::HTTP_FOUND);
} A new session has been created, but method |
Hello @nepster-web, |
Hello again @nepster-web, @froschdesign |
This repository has been closed and moved to mezzio/mezzio-session; a new issue has been opened at mezzio/mezzio-session#2. |
I see that SessionInterface does not provide the ability to session destroy .
I am writing my session handler that works with the database.
I created my middleware, which is called before zend-expressive-session-ext and zend-expressive-session:
It all works, the difference is not noticeable.
But I had a problem with logout.
Solution to the problem:
So, why the SessionInterface doesn't have a destroy method? I think this can be a problem in some cases.
The text was updated successfully, but these errors were encountered: