Edit session of other users in PHP

Is it possible in PHP to edit a different user session than the current user? If so, how?

+7
php session
source share
2 answers

You can edit the session of other users in php in several ways:

  • First of all, you need to get the SessionID of the user for whom you want to change the session;

    session_id($SessionID); // and then enter code your logic to change session data here; 
  • If you store session data in a database, it would be even easier to manipulate the data directly in the database, which would update the user session when the application again requests the data.

Remember that you can play with a user session to any level, the only thing required is SESSION_ID. If you realized that you won the game,

+10
source share

It depends on the method that the server uses to store session data. I think that there can be several ways to store as a database, files on the server, memcache server. therefore you must use the correct path.

Anyway, I did web programming in just 5 months. so i'm not sure what i said.

+3
source share

All Articles