A number of the PHP configuration settings in the php.ini file can be altered with PHP function ini_set(). However, key variables to operate a custom session handler require the following settings outside the reach of ini_set():
session.auto_start
session.save_handler = user
session.save_path
session.name
session.gc_maxlifetime
session.gc_probability
In an autonomous development environment, it is easy to set the proper configuration.
What happens in a virtual hosting environment with numerous domains using PHP and MySQL? Do domains have their own php.ini file or do they need to share the same one with the resulting conflicts and/or frustrations? Can the server administrators resort to some trick to let each domain do its own thing?
Since the session.save_path, .name, .gc_maxlifetime and .gc_probability settings are passed as values to the custom session handler, could we feed the handler functions by values rather than by variables?
In the worst scenario, for the first two settings, one would need to find a web site hoster that imposes session.auto_start = Off and session.save_handler = user on all hosted domains. It doesn't sound smart at all.
If there is an easy solution, I will surely appreciate to know about it.