Multiple Session Instances Codeigniter

拜拜、爱过 提交于 2019-12-13 22:18:36

问题


So I have an app built using Codeigniter and we are experiencing some trouble when a session is loaded and someone loads another URL that would start a session with the same app.

The problem is that the second session is overwriting the initial session (at least partially) and corrupting the data being sent.

We are using database sessions and encryption.

Looking for help on this. Thanks in advance.


回答1:


Here's a previous thread for you:

Multiple PHP Sessions

Another thing not mentioned in that thread is, if you need multiple sessions for the same data/data placeholders, to prepend the session variables with identifying prefixes, e.g.:

$_SESSION['ss1_name'] = "Session 1 Name";

...

$_SESSION['ss2_name'] = "Session 2 Name";

Hope this helps!



来源:https://stackoverflow.com/questions/6075658/multiple-session-instances-codeigniter

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