symfony/symfony — pull request #4208 by vicb (2012-05-05 17:21:05+00:00)
Title: [RFC][Session] Native storage handlers should not update the global config

I submit this as a RFC because we can not get to an agreement on things should be done with @drak and I would like to hear the voice of the community on this point.

Memcache will be used as an example for the discussion.

**Context**

When you want to use memcache to store your sesssion data, you will need to create an instance of "NativeMemcacheSessionHandler" and pass the `save_path` as argument. The `save_path` specify the host, port and a few options (i.e. the ones passed to [addServer](http://www.php.net/manual/fr/memcache.addserver.php)).

All the other options (i.e. the compression factor, the serializer, ...) are retrieved from the ini values.

**What we do today**

In order to configure the native memcache storage the `NativeMemcacheSessionHandler` class [update](https://github.com/symfony/symfony/blob/7dfd41048120cd884db63ee8074452dc7c17134c/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/NativeMemcacheSessionHandler.php#L64) the ini values.

**What I propose**

I propose **not** to update any ini value that is gobal to **all the** memcache instances. To me ini values are global configs that should not be updated for a local need.
_(I am ok with updating session specific settings ('memcache.session_redundancy') because those are not shared by all the memcache instances)_

In order to configure the memcache native storage:

- update your php.ini with the desired value,
- or if you don't have access to the php.ini (i.e. on a shared server) set the value at some "global" place (i.e. your kernel).

**The question**

Do you think:

A- It is ok to change any ini settings from inside the Session ? (The current state)
B- We should not modify any ini settings that is not strictly related to the session from inside the session. (The state after this PR)