Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can PHP sessions be manually edited?

Tags:

php

Can PHP sessions be edited like cookies? Or they're stored on the webhost?

like image 899
FinalDestiny Avatar asked Feb 14 '10 16:02

FinalDestiny


2 Answers

The session key is stored in the client's browser, while the data is stored on the server.

When the user makes a request on the server, their session key is sent across the network and the values associated with their key are retrieved from the specific session file on the server and are made accessible via $_SESSION.

It it possible to hijack another user's session if the key is intercepted, which is why you should have specific values in the session which associate to the user's computer/network connection (IP address, for example).

like image 119
Tim Cooper Avatar answered Oct 27 '22 20:10

Tim Cooper


Session data cannot be edited by the user, as they are stored on the server. The user can, however, start a new session and ditch whatever session data he previously had. Also, you should be aware of portential security issues, such as session fixation.

like image 39
Will Vousden Avatar answered Oct 27 '22 20:10

Will Vousden