Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

can users change session variables?

Tags:

cakephp

Or are they only manipulated by the server? For instance, can we always assume that Auth.User.Id always corresponds to the current user?

like image 223
chalpert Avatar asked Sep 26 '10 17:09

chalpert


People also ask

Can session be modified?

A user cannot modify PHP sessions on the server. They can only forge a legitimate cookie and masquerade as a logged-in user - but that will require them to steal a valid cookie in the first place.

Can the client access session variables?

Session variables can be accessed on the client side. For example you could check the value by calling: alert('<%=Session["RegisterId"] %>'); Anything between the "<%" and "%>" runs at the server so it will evaluate the current value of the session.

Can users change cookie value?

Cookies are in control of the user. Anyone can add, delete, or alter the value of any cookie.

Can you change session variable PHP?

Update Session Variable in PHP To update any value stored in the session variable, start the session by calling session_start() function and then simply overwrite the vakue to update session variable.


1 Answers

Session variables are always kept and protected at the server. When using PHP's default implementation at least. So yes, as long as its set right.

Only a unique ID identifying the session is sent to the client.

like image 104
Alexander Sagen Avatar answered Oct 11 '22 08:10

Alexander Sagen