8000 [FrameworkBundle] Allow to set null for the handler in NativeSessionStorage · Pull Request #5290 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[FrameworkBundle] Allow to set null for the handler in NativeSessionStorage #5290

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

Merged
merged 1 commit into from Aug 18, 2012
Merged

[FrameworkBundle] Allow to set null for the handler in NativeSessionStorage #5290

merged 1 commit into from Aug 18, 2012

Conversation

ghost
Copy link
@ghost ghost commented Aug 17, 2012

Bug fix: no
Feature addition: yes (ok for RC)
Backwards compatibility break: yes
Symfony2 tests pass: yes
Fixes the following tickets: 5267
Todo: ~
License of the code: MIT
Documentation PR: ~

Refs #5267

Adds the following configuration

session:
        handler_id: ~

Which allows the configuration of the session not to use any save handler and therefor just use whatever save_handler is set in php.ini

@travisbot
Copy link

This pull request passes (merged 8e11aaa into d3625b0).

@dlsniper
Copy link
Contributor

👍

fabpot added a commit that referenced this pull request Aug 18, 2012
Commits
-------

8e11aaa [FrameworkBundle] Allow to set null for the handler in NativeSessionStorage

Discussion
----------

[FrameworkBundle] Allow to set null for the handler in NativeSessionStorage

Bug fix: no
Feature addition: yes (ok for RC)
Backwards compatibility break: yes
Symfony2 tests pass: yes
Fixes the following tickets: 5267
Todo: ~
License of the code: MIT
Documentation PR: ~

Refs #5267

Adds the following configuration

```
session:
        handler_id: ~
```

Which allows the configuration of the session not to use any save handler and therefor just use whatever save_handler is set in `php.ini`

---------------------------------------------------------------------------

by dlsniper at 2012-08-17T17:24:37Z

:+1:
@fabpot fabpot merged commit 8e11aaa into symfony:master Aug 18, 2012
@@ -294,7 +294,12 @@ private function registerSessionConfiguration(array $config, ContainerBuilder $c
$container->setParameter('session.storage.options', $options);

// session handler (the internal callback registered with PHP se 8000 ssion management)
$container->setAlias('session.handler', $config['handler_id']);
if (null == $config['handler_id']) {
Copy link
Member

Choose a reason for hiding this comment

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

this should be a strict comparison

nicolas-grekas added a commit that referenced this pull request Mar 28, 2023
…id is null (nicolas-grekas)

This PR was merged into the 5.4 branch.

Discussion
----------

[FrameworkBundle] Fix wiring session.handler when handler_id is null

| Q             | A
| ------------- | ---
| Branch?       | 5.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

When the session `handler_id` is null, we currently set the `$handler` argument of the storage/factory services to null, which means to them "create your own handler internally from the native one". This means that the `session.handler` service is "a lie": it's not the real handler used by the storage. It also means that the `%session.save_path%` parameter is lying too, because it is set to `%kernel.cache_dir%/sessions` (by default), while the storage will use `ini_get('session.save_path')` in practice.

This issue is 10 years old... #5290

Commits
-------

e23be58 [FrameworkBundle] Fix wiring session.handler when handler_id is null
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.

4 participants
0