Answer the question
In order to leave comments, you need to log in
How safe is PHP to store data in $_SESSION?
After some study of this issue, I came to the conclusion that it is quite safe: the file is created on the server, in no way transmitted to the client. Maybe I'm mistaken?
And what can happen to the data if the server does not support cookies, but the client has them enabled?
Answer the question
In order to leave comments, you need to log in
Absolutely right. PHP stores serialized session data in a file on the server. Between pages, only the session ID is transmitted and it is transmitted just with the help of cookies. Theoretically, you can steal the session ID, thereby gaining access to session data from another device, but it’s quite easy to make additional protection by linking the session to an IP, for example (store it in the session and check every time if the client’s IP changes, reset the session) or use SSL on your site if there is enough important information on it, in other cases I think you can not bother, but still watch what you do - you make your scripts safe, not PHP.
After some study of this issue, I came to the conclusion that it is quite safe: the file is created on the server, in no way transmitted to the client. Maybe I'm mistaken?
the file is created on the server, in no way transmitted to the client. Maybe I'm mistaken?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question