CodeIgniter “sess_time_to_update” and Indy Cookies

╄→尐↘猪︶ㄣ 提交于 2019-12-25 08:57:09

问题


I have this horribly stripped delphi code that basically login to server, save cookie in a global cookie manager, then upload files in threads (using Delphi 2010 + Indy 10.4736)

Each thread reads the global cookie manager and upload the file. Server side, I'm using PHP with CodeIgniter.

Everything works just fine, except that CodeIgniter has this sess_time_to_update setting in config.

This *sess_time_to_update* defaults to 300 seconds after which CodeIgniter completely regenerate the session id.

This is good for security, but this also invalidates my login/cookie info in indy.

My question is: how can I avoid this without adjusting *sess_time_to_update*? Is there some setting in Indy to make it aware of the session id? Should I add a timer and automatically re-login every 300 seconds (or less)? What's the best approach to make Indy handle this situation?

Thanks!

EDIT FWIW: the global cookie manager contains something like this


回答1:


When CodeIgniter generates a new session, it should include the session ID in the cookies for each response it sends. Update your global cookie list so that subsequent requests will use the new ID instead of continuing to use the original value.



来源:https://stackoverflow.com/questions/9830746/codeigniter-sess-time-to-update-and-indy-cookies

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!