cakePHP会话过期太快 [英] cakePHP Session expiring too soon

查看:164
本文介绍了cakePHP会话过期太快的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已将 Configure :: write('Security.level','medium'); 设置为低,设置 Configure :: write 'Session.timeout','120'); 到更高的数字,在 cake / libs / security.php c $ c> inactiveMins()函数到以下

I have set Configure::write('Security.level', 'medium'); to low, set Configure::write('Session.timeout', '120'); to higher numbers, and in cake/libs/security.php I have set the inactiveMins() function to the following,

function inactiveMins() {
    switch (Configure::read('Security.level')) {
        case 'high':
            return 10;
        break;
        case 'medium':
            return 100;
        break;
        case 'low':
        default:
            return 550;
            break;
    }
}

但会话仍在120分钟后到期。这是一个时间跟踪应用程序,所以我想有让应用程序在后台运行直到需要的功能。但会话关闭太早。是否有其他方法让会话一次打开几个小时,因为这些选项不工作?

But sessions are still expiring at around 120 minutes. This is a time tracking app so I would like to have the functionality of leaving the app running in the background until needed. But the session closes too soon. Is there another way to leave the session open for hours at a time since these options aren't working?

从APP / CONFIG / CORE.PHP * **

From APP/CONFIG/CORE.PHP ***

/**
 * Session time out time (in minutes).
 * Actual value depends on 'Security.level' setting.
 */
    Configure::write('Session.timeout', '120');

核心版本1.3.4

推荐答案

php.ini文件是覆盖蛋糕设置。更改配置:: write('Session.save','php'); 到 '); app / config / core.php

php.ini file was overriding cake settings. Changed Configure::write('Session.save', 'php'); to Configure::write('Session.save', 'cake'); in app/config/core.php

这篇关于cakePHP会话过期太快的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆