weixin_33725272 2014-12-12 06:42 采纳率: 0%
浏览 15

Cakephp,Ajax会话错误

Current Setup :

Cakephp version 2.3.4.

Session configurations are :

Configure::write('Session', array(
    'defaults' => 'php',
    'timeout' => '1440', // The session will timeout after 24 hours of inactivity
    'cookieTimeout' => '1440', // The session cookie will live for at most 24 hours, this does not effect session timeouts
    'checkAgent' => false,
    'autoRegenerate' => true, // causes the session expiration time to reset on each page load
));

Problem

When user login then I write userId in session like this $this->Session->write('user_id',123) and for other API call I read user_id from session like $this->Session->read('user_id');

Problem is sometimes ( manytimes ) $this->Session->read('user_id') gives me nothing like session cookies has been expired.

I read all over on google and stackoverflow and not able to figure out.

Any help Thanks Amit Aggarwal

  • 写回答

0条回答 默认 最新

      报告相同问题?

      悬赏问题

      • ¥15 (SOS)安卓集成一个插件
      • ¥15 最小生成树问题 Prim算法和Kruskal算法
      • ¥25 医院住院病人呼叫器设计
      • ¥15 不想和现在的团队合作了,怎么避免他们对程序动手脚
      • ¥30 c++类和数组实验代码
      • ¥20 C语言字符串不区分大小写字典排序相关问题
      • ¥15 关于#python#的问题:我希望通过逆向技术爬取1688搜索页下滑加载的数据
      • ¥15 关于Linux的终端里,模拟实现一个带口令保护的屏保程序遇到的输入输出的问题!(语言-c语言)
      • ¥30 请问,这个嵌入式Linux系统怎么分析,crc检验区域在哪
      • ¥15 二分类改为多分类问题