Skip to content

AbstractSessionHandler implements SessionIdInterface #47071

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/Symfony/Component/HttpFoundation/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
CHANGELOG
=========

6.2
---
* Implement `SessionIdInterface` in `AbstractSessionHandler`

6.1
---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*
* @author Nicolas Grekas <p@tchwork.com>
*/
abstract class AbstractSessionHandler implements \SessionHandlerInterface, \SessionUpdateTimestampHandlerInterface
abstract class AbstractSessionHandler implements \SessionHandlerInterface, \SessionIdInterface, \SessionUpdateTimestampHandlerInterface
{
private string $sessionName;
private string $prefetchId;
Expand All @@ -34,7 +34,6 @@ public function open(string $savePath, string $sessionName): bool
if (!headers_sent() && !\ini_get('session.cache_limiter') && '0' !== \ini_get('session.cache_limiter')) {
header(sprintf('Cache-Control: max-age=%d, private, must-revalidate', 60 * (int) \ini_get('session.cache_expire')));
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This must be reverted by applying fabbot's patch. There must be a space before return.

return true;
}

Expand All @@ -44,6 +43,10 @@ abstract protected function doWrite(string $sessionId, string $data): bool;

abstract protected function doDestroy(string $sessionId): bool;

public function create_sid():string{
return session_create_id();
}

public function validateId(string $sessionId): bool
{
$this->prefetchData = $this->read($sessionId);
Expand Down