是否可以在 PHP 中编辑当前用户以外的其他用户会话?如果是这样怎么办?
Is it possible in PHP to edit another users session other than the current user? If so how?
推荐答案可以通过以下几种方式在 php 中编辑另一个用户会话:
It is possible to edit another users session in php through couple of ways:
第一种方法是您必须获取要为其编辑会话的用户的 SessionID;
1st way is to you have to get SessionID of the user for which you want to edit session; session_id($SessionID); // and then enter code your logic to change session data here;
如果您将会话数据存储在数据库中,那么直接在数据库中操作数据会更容易,这会在应用程序再次请求数据时更新用户会话.
If you are storing your session data in database then it would be even easier to manipulate data directly in database which would update user session when application will request data again.
请记住,您可以将用户会话玩到任何级别,唯一需要的是 SESSION_ID.如果你知道你赢得了比赛;
Remember you can play with user session up to any level the only thing required is SESSION_ID. If you got that you won the game;
更多推荐
在 PHP 中编辑另一个用户会话
发布评论