dongyi1111 2011-03-05 12:11
浏览 51

Zend Framework - Zend_Session奇怪的行为

I'm just learning Zend Framework following it's official documentation at the website.

But I'm stucked with a strange behavior of Zend_Session: when user is authenticated, surfing the application pages - everything is ok but if he refresh the browser page quickly (pressing F5 or button in the toolbar) or even if some AJAX php file (that uses session) is requested multiple times, - the session suddenly expires (user is unauthenticated, however cookies expire dates are the same).

Though, I'm not using ACL and MVC structure in my application.

So it works and it is very simple but fails when page is refreshed quickly. Also I don't know why but a separate cookie file is created in /home/user/sessions/ for each page user has visited.

There is a similiar question here zend session expires when refreshed many times but the solution provided doesn't help me :(

  • 写回答

1条回答 默认 最新

  • doushi1912 2012-01-29 10:56
    关注

    In you config, you should set up something like this:

    ;; ========================= Session ===========================================
    resources.session.save_path = APPLICATION_PATH "/../data/session"
    resources.session.name = "SESSION"
    resources.session.gc_maxlifetime =  5184000
    resources.session.gc_probability = 1
    resources.session.gc_divisor = 1000
    resources.session.remember_me_seconds = 5184000
    resources.session.cookie_lifetime = 5184000
    

    That should do it.

    评论

报告相同问题?

悬赏问题

  • ¥15 R语言Rstudio突然无法启动
  • ¥15 关于#matlab#的问题:提取2个图像的变量作为另外一个图像像元的移动量,计算新的位置创建新的图像并提取第二个图像的变量到新的图像
  • ¥15 改算法,照着压缩包里边,参考其他代码封装的格式 写到main函数里
  • ¥15 用windows做服务的同志有吗
  • ¥60 求一个简单的网页(标签-安全|关键词-上传)
  • ¥35 lstm时间序列共享单车预测,loss值优化,参数优化算法
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值