Edit another users session in PHP

匿名 (未验证) 提交于 2019-12-03 02:56:01

问题:

Is it possible in PHP to edit another users session other than the current user? If so how?

回答1:

It is possible to edit another users session in php through couple of ways:

  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; 
  2. 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.

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;



回答2:

It depends on method which server use to store the session data. I think there maybe a few ways to store like database, files on server, memcache server. so you have to use a proper way.

anyway I've done web programming just for 5 months. so I'm not sure what I said.



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