Does CodeIgniter's sess_create() delete previous session?

半腔热情 提交于 2019-12-11 01:13:49

问题


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

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