问题
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