-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
Respect ini session.use_strict_mode #18247
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
Respect ini session.use_strict_mode #18247
Conversation
|
👍
Good plan. |
… that native storage also can be configured using Yii Session object)
|
@samdark If this PR is approved I'll also implement the |
|
The failing of the tests seem to have something to do with https://www.leaseweb.com/labs/2012/08/ps_files_cleanup_dir-permission-denied/ |
…opendir(/var/lib/php5) failed: Permission denied (13)" error when staring a session when testing (also see https://www.leaseweb.com/labs/2012/08/ps_files_cleanup_dir-permission-denied/)
…(): ps_files_cleanup_dir: opendir(/var/lib/php5) failed: Permission denied (13)" error when staring a session when testing (also see https://www.leaseweb.com/labs/2012/08/ps_files_cleanup_dir-permission-denied/)
…ssion_start(): ps_files_cleanup_dir: opendir(/var/lib/php5) failed: Permission denied (13)" error when staring a session when testing (also see https://www.leaseweb.com/labs/2012/08/ps_files_cleanup_dir-permission-denied/)
|
Found the problem. In the Github action, phpunit runs under the 'runner' user (locally it's under the 'root' user). |
That's indeed something I also haven't figured out yet. It looks like the session table isn't correctly created during the |
Redis (yiisoft/yii2-redis#212) and MongoDB (yiisoft/yii2-mongodb#319) pull requests are created. Their build fails at the moment because they require this unreleased Yii2 version. |
* Implemented polyfill for Session::$useStrictMode for PHP < 5.5.2 * Fixed tests for polyfill for Session::$useStrictMode for PHP < 5.5.2 * Added note that enabling `useStrictMode` on PHP < 5.5.2 is only supported with custom storage classes.
|
@samdark I've found the reason why the PHP 5.4 build failed, session.use-strict-mode is only available since PHP 5.5.2. |
…_ini_session_use_strict_mode # Conflicts: # framework/UPGRADE.md
Perhaps I was to strict with my answer in the "Breaks BC?" question in the opening post. At the moment I don't see any way it would break existing installations. The only thing is that this option won't work if |
Likely it's fine. I've moved MongoDB to GitHub actions and is now ready to continue with the PR. |
If you mean that the build fails? That's because it depends on this PR to be released first. Currently it depends on a Yii version that does not yet include the required changes in framework/web/Session.php |
|
I've meant "now". That was an interesting typo :) |
Session::openSession()and/orSession::writeSession()are overwritten.Implements support for session.use_strict_mode by the Yii2 Session handler.
When a session is started with a non existing session id a new id will be generated. This imitates the behavior for the
session_set_save_handlervalidate_sidparam (which requires PHP >= 7.0).The session will only be stored under the newly generated id.
To Do's to fully implement:
yii\web\CacheSessionyii\web\DbSessionyii\redis\Session(yiisoft/yii2-redis#212)yii\mongodb\Session(yiisoft/yii2-mongodb#319)