yii2: PHP 7.2: session_cache_limiter(): Cannot change cache limiter when session is active
What steps will reproduce the problem?
Hitting a page with HttpCache::className()
defined in behaviours
in the controller
What is the expected result?
A working page
What do you get instead?
PHP Warning – yii\base\ErrorException
session_cache_limiter(): Cannot change cache limiter when session is active
1. in /homepages/user/htdocs/yii/vendor/yiisoft/yii2/filters/HttpCache.php at line 192
2. yii\base\ErrorHandler::handleError(2, 'session_cache_limiter(): Cannot ...', '/homepages/user/htdocs/...', 192, ...)
3. in /homepages/user/htdocs/yii/vendor/yiisoft/yii2/filters/HttpCache.php at line 192 – session_cache_limiter('')
4. in /homepages/user/htdocs/yii/vendor/yiisoft/yii2/filters/HttpCache.php at line 138 – yii\filters\HttpCache::sendCacheControlHeader()
5. in /homepages/user/htdocs/yii/vendor/yiisoft/yii2/base/ActionFilter.php at line 75 – yii\filters\HttpCache::beforeAction(yii\base\InlineAction)
6. yii\base\ActionFilter::beforeFilter(yii\base\ActionEvent)
7. in /homepages/user/htdocs/yii/vendor/yiisoft/yii2/base/Component.php at line 557 – call_user_func([yii\filters\HttpCache, 'beforeFilter'], yii\base\ActionEvent)
8. in /homepages/user/htdocs/yii/vendor/yiisoft/yii2/base/Controller.php at line 274 – yii\base\Component::trigger('beforeAction', yii\base\ActionEvent)
9. in /homepages/user/htdocs/yii/vendor/yiisoft/yii2/web/Controller.php at line 164 – yii\base\Controller::beforeAction(yii\base\InlineAction)
10. in /homepages/user/htdocs/yii/vendor/yiisoft/yii2/base/Controller.php at line 155 – yii\web\Controller::beforeAction(yii\base\InlineAction)
11. in /homepages/user/htdocs/yii/vendor/yiisoft/yii2/base/Module.php at line 528 – yii\base\Controller::runAction('index', [])
12. in /homepages/user/htdocs/yii/vendor/yiisoft/yii2/web/Application.php at line 103 – yii\base\Module::runAction('lyrics/index', [])
13. in /homepages/user/htdocs/yii/vendor/yiisoft/yii2/base/Application.php at line 386 – yii\web\Application::handleRequest(yii\web\Request)
14. in /homepages/user/htdocs/yii/webroot/index.php at line 18 – yii\base\Application::run()
Additional info
Q | A |
---|---|
Yii version | 2.0.12-dev |
PHP version | PHP 7.2.0RC1 |
Operating system | Debian 3.14.77-2~ui80+4 |
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 19 (15 by maintainers)
Commits related to this issue
- #14811 fixed freeze/unfreeze in HttpCache — committed to yiisoft/yii2 by samdark 6 years ago
遇到同样的问题,已经按照方法解决,thanks
Should be alright now.
components.session
part, no change