2013-10-04 21:24
浏览 64


I have an application which is under development in CodeIgniter. But I have a problem with session management. By default, sessions in CodeIgniter are saved onto the visitor's machine, which means they last about two hours without being deleted on the close action (visitor closing the browser); while all of us know that PHP keeps session as long as the browser runs, and as it is closed by the user, it will kill it.

My problem: I love CI session style, but for some particular purposes and in some instances I need PHP session style (being deleted when browser is closed). CI provides me such option but I do not like to delete all sessions when the browser is closed. I need only two or three session values to be removed on browser shut down. Should I use go back to PHP pure session for the instances where sessions must be delete on browser shut down? Or CI has some options for customizing the lifespan of session for individual vlaues?

thanks in advance

图片转代码服务由CSDN问答提供 功能建议

我有一个正在CodeIgniter中开发的应用程序。 但我遇到会话管理问题。 默认情况下,CodeIgniter中的会话将保存到访问者的计算机上,这意味着它们可以持续大约两个小时而不会在关闭操作上被删除(访问者关闭浏览器); 虽然我们所有人都知道,只要浏览器运行,PHP就会保持会话,并且当用户关闭它时,它会终止它。 </ p>

我的问题:我喜欢CI会话风格,但出于某些特定目的,在某些情况下我需要PHP会话风格(在浏览器关闭时被删除)。 CI为我提供了这样的选项,但我不想在浏览器关闭时删除所有会话。 我只需要在浏览器关闭时删除两个或三个会话值。 对于必须在浏览器关闭时删除会话的实例,我应该使用返回PHP纯会话吗? 或CI有一些选项可以自定义单个版税的会话生命周期?</ p>

提前感谢</ p> </ div>

1条回答 默认 最新

相关推荐 更多相似问题