在 PHP 中编辑另一个用户会话 [英] Edit another users session in PHP

查看:33
本文介绍了在 PHP 中编辑另一个用户会话的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在 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:

  1. 第一种方法是您必须获取要为其编辑会话的用户的 SessionID;

  1. 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 中编辑另一个用户会话的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

  • 查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆