lionware/symfony-session-timeout
最新稳定版本:v1.0.3
Composer 安装命令:
composer require lionware/symfony-session-timeout
包简介
Invalidate Symfony sessions based on inactivity for a certain period of time
README 文档
README
Invalidate Symfony sessions based on inactivity for a certain period of time.
This does not make use of garbage collection as suggested in http://symfony.com/doc/current/components/http_foundation/session_configuration.html#session-idle-time-keep-alive. This method is more accurate and does not depend on garbage collection parameters to function well.
Installation
Add SymfonySessionTimeout in your composer.json
{
"require": {
"lionware/symfony-session-timeout": "*"
}
}
Register the bundle in your app/AppKernel.php:
public function registerBundles() { $bundles = array( // ... new Lionware\SymfonySessionTimeoutBundle\LionwareSymfonySessionTimeoutBundle() ); )
Add the parameter in app/config/parameters.yml and set the value to your preferred expiration time (which is set to an hour in this example).
parameters: lionware_session_expiration_time: 3600
Add the configuration in app/config/config.yml
lionware_symfony_session_timeout: session: expiration_time: "%lionware_session_expiration_time%"
Notes
Cookie expiration
Expiration of the cookie also means expiration of the session, therefore it is wise to set it to a relatively high value or 0 (valid for the length of the browser session).
# app/config/config.yml framework: session: cookie_lifetime: 0
统计信息
- 总下载量: 36.83k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 16
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-09-01