Is it safe to store values ​​in a session?

I am developing a web application where UserId and RoleId play a vital role ... Is it safe to store these values ​​in a session. Some may be hidden, cookies .. Which is more secure?

Any suggestion for this ...

+3
source share
5 answers

Sessions are safer than cookies and hidden fields because they are stored on the server. Cookies usually should not contain confidential data, even encrypted, as users have direct access to them. Hidden fields are also sent to the client, but simply are not displayed. Therefore, using tools such as FireBug , you can easily display this content.

There are various places in which you can store the session, for example, in memory (if you do not use them a lot) or support their SQL server. You can get more session information here . Sessions are secure because they are stored on the server side.

+7
source

, cookie, , . , , . , , cookie, .

+4

"" , . , , , . , , .

+1

, cookie.

The difference is that SESSION values ​​are stored in SERVER, and hidden fields and cookies are stored on the client.

0
source

A session will be more secure than a cookie (the session is stored in memory on the server where the cookie is sent to the client).

0
source

Source: https://habr.com/ru/post/1726306/


All Articles