Change Session None to use PHP session configuration instead of trying to force file mode #1839

merged 1 commit into from Feb 24, 2013


None yet

1 participant

ghost commented Feb 20, 2013

Currently, using the set_ini function to force file usage for sessions will only work if PHP is already configured to store sessions in files. If it is configured for a different session storage, such as memcached, the session_path variable points to the session server, not a file path, and thus setting file mode breaks when it tries to save to a file using the session path variable.

My hypothesis is that at one point in time that set_ini was used in JSession in order to change the PHP session handling process and that this set_ini was used to put PHP back into file mode[blindly assuming it was in file mode to begin with].

With the current PHP session handling function registration method, that hypothetical process was replaced and this set_ini call was left lying around by mistake. Since most PHP configurations just use file session handling, this ini call "works" for 95% of sites, but causes problems on the 5% using alternate methods.

I don't see how removing it can cause any problems for the 95% and will fix things for the 5% - as such this fixes Joomla! Session handling for everyone.

Gary A. Mort Removed set_ini function as it will only work if the session path is …
…set to a writable file path - ie PHP is already configured to use file session handling. If it is using Memcached or some other system, the session path is generally the url for the session storage server and will then break if PHP is forced into file mode.

Also modified documentation on JSessionStorageNone so that it specifies that this session mechanism uses the PHP configured session mechanism, which is generally the file method but does not have to be.
@ghost Unknown referenced this pull request Feb 20, 2013

JSession enhancements #1766

@eddieajau eddieajau merged commit 15c5fa7 into joomla:staging Feb 24, 2013
@mbabker mbabker added a commit to joomla/joomla-framework that referenced this pull request Mar 3, 2013
@mbabker mbabker Port joomla/joomla-platform#1839 86ce751
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment