Thanks to visit codestin.com
Credit goes to github.com

Skip to content

{HttpFoundation] [Session] fixed session compatibility with memcached/re... #8776

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 1 commit into from

Conversation

klmatom
Copy link

@klmatom klmatom commented Aug 16, 2013

...dis session storage

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? no (no new failng/errors introduced)
Fixed tickets 7380
License MIT

Per https://bugs.php.net/bug.php?id=61470, and in fixing #7380, the following error occurs when using a Memcache or Redis session store w/ Symfony security: "Authentication exception occurred; redirecting to authentication entry point (A Token was not found in the SecurityContext.)". This patch applies the first fix only if the session store is "files"

} else {
session_start();
if($this->getSaveHandler()->getSaveHandlerName() == 'files')
{
Copy link
Contributor

Choose a reason for hiding this comment

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

Curly bracket should be in the same line as the if statement. === should is preferred over ==.

@jakzal
Copy link
Contributor

jakzal commented Aug 16, 2013

Could you add a test? It should fail before applying this fix.

…/redis session storage

Per https://bugs.php.net/bug.php?id=61470, and in fixing symfony#7380, the following error occurs when using a Memcache or Redis session store w/ Symfony security: "Authentication exception occurred; redirecting to authentication entry point (A Token was not found in the SecurityContext.)".  This patch applies the first fix only if the session store is "files"

{HttpFoundation] [Session] fixed session compatibility with memcached/redis session storage

Per https://bugs.php.net/bug.php?id=61470, and in fixing symfony#7380, the following error occurs when using a Memcache or Redis session store w/ Symfony security: "Authentication exception occurred; redirecting to authentication entry point (A Token was not found in the SecurityContext.)".  This patch applies the first fix only if the session store is "files"
@klmatom
Copy link
Author

klmatom commented Aug 16, 2013

Fixed and commits squashed. Do you have a suggestion how should I go about writing a test case for this?

$_SESSION = $backup;
} else {
session_start();
if($this->getSaveHandler()->getSaveHandlerName() === 'files') {
Copy link
Member

Choose a reason for hiding this comment

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

CS: if ('files' === $this->getSaveHandler()->getSaveHandlerName()) {

@fabpot
Copy link
Member

fabpot commented Aug 17, 2013

Not sure how this could be tested easily.

fabpot added a commit that referenced this pull request Aug 17, 2013
This PR was submitted for the master branch but it was merged into the 2.2 branch instead (closes #8776).

Discussion
----------

{HttpFoundation] [Session] fixed session compatibility with memcached/re...

...dis session storage

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | no (no new failng/errors introduced)
| Fixed tickets | 7380
| License       | MIT

Per https://bugs.php.net/bug.php?id=61470, and in fixing #7380, the following error occurs when using a Memcache or Redis session store w/ Symfony security: "Authentication exception occurred; redirecting to authentication entry point (A Token was not found in the SecurityContext.)".  This patch applies the first fix only if the session store is "files"

Commits
-------

eb8d8eb {HttpFoundation] [Session] fixed session compatibility with memcached/redis session storage
@fabpot fabpot closed this Aug 17, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants