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

AbstractSessionHandler implements SessionIdInterface #47071

wants to merge 4 commits into from

Conversation

d3n972
Copy link

@d3n972 d3n972 commented Jul 26, 2022

Q A
Branch? 6.2
Bug fix? no
New feature? yes
Deprecations? no
Tickets Fix #45186
License MIT
Doc PR none

Add SessionIdInterface as implemented interface to AbstractSessionHandler to create the possibility of creating/setting the correct session id if it is provided in an alternative manner. For example, you can implement a custom create_sid() method in a SessionHandler class which uses the AbstractSessionHandler.

@carsonbot
Copy link

Hey!

I see that this is your first PR. That is great! Welcome!

Symfony has a contribution guide which I suggest you to read.

In short:

  • Always add tests
  • Keep backward compatibility (see https://symfony.com/bc).
  • Bug fixes must be submitted against the lowest maintained branch where they apply (see https://symfony.com/releases)
  • Features and deprecations must be submitted against the 6.2 branch.

Review the GitHub status checks of your pull request and try to solve the reported issues. If some tests are failing, try to see if they are failing because of this change.

When two Symfony core team members approve this change, it will be merged and you will become an official Symfony contributor!
If this PR is merged in a lower version branch, it will be merged up to all maintained branches within a few days.

I am going to sit back now and wait for the reviews.

Cheers!

Carsonbot

@d3n972 d3n972 changed the title AbstractSessionHandler implements SessionIdInterface WIP: AbstractSessionHandler implements SessionIdInterface Jul 26, 2022
@d3n972 d3n972 marked this pull request as draft July 26, 2022 21:08
@d3n972 d3n972 changed the title WIP: AbstractSessionHandler implements SessionIdInterface AbstractSessionHandler implements SessionIdInterface Jul 26, 2022
@d3n972 d3n972 marked this pull request as ready for review July 26, 2022 21:21
@carsonbot
Copy link

Hey!

I see that this is your first PR. That is great! Welcome!

Symfony has a contribution guide which I suggest you to read.

In short:

  • Always add tests
  • Keep backward compatibility (see https://symfony.com/bc).
  • Bug fixes must be submitted against the lowest maintained branch where they apply (see https://symfony.com/releases)
  • Features and deprecations must be submitted against the 6.2 branch.

Review the GitHub status checks of your pull request and try to solve the reported issues. If some tests are failing, try to see if they are failing because of this change.

When two Symfony core team members approve this change, it will be merged and you will become an official Symfony contributor!
If this PR is merged in a lower version branch, it will be merged up to all maintained branches within a few days.

I am going to sit back now and wait for the reviews.

Cheers!

Carsonbot

Copy link
Member

@GromNaN GromNaN left a comment

Choose a reason for hiding this comment

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

Hello @d3n972, I see this is your first PR. Congratulations for this initiative. There is some style changes to be applied using the patch provided by fabbot in CI.

I'm not sure about the usefulness of this change. If people wants to customize the session id generator, they can implement the interface in their custom child class. The default implementation in the abstract class doesn't add value. Am I wrong?

@@ -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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Symfony Session Handlers should implement SessionIdInterface interface
3 participants