问题
I am going to create a function called login_as_member($member_id)
that lets the admins log in exactly as a member.
In member login()
method, I've used sess_created()
.
Now I want to see whether I use that method or not? For sure, I do not want the admin to be logged out when loggin as member.
Please tell me if using that method corrupts admin's current session or not.
In fact I'd like to know what exactly does sess_create()
does?
回答1:
sess_create()
will create a new session for the user. The newly created session will overwrite the currently existing one.
One thing you could probably do is to have any data necessary from the admin session stored inside the new user session and then when the admin wants to log out of the user account, automatically log the admin in again.
来源:https://stackoverflow.com/questions/9256279/does-codeigniters-sess-create-delete-previous-session