G
G
goodbyeworld2014-04-24 09:03:00
Computer networks
goodbyeworld, 2014-04-24 09:03:00

Should I store encrypted data in a cookie?

Is it worth storing data with the user that can only be decrypted on the server? For example, JSON strings with data (name, personal settings, etc.) of the user. Can there be problems?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
S
Sergey, 2014-04-24
@begemot_sun

Cookies are needed to store a small amount of data (these are not pies). If you want to push the user session there (and this can be a lot of information), then get ready for a lot of traffic.
PS I would not engage in such perversions.

A
Alexey, 2014-04-24
Rekhov @Zorato

Some not the most secret data is of course possible. For example, in Laravel there is an implementation of sessions on encrypted cookies (although I would not dare to store the session in this way).

K
kazhuravlev, 2014-04-24
@kazhuravlev

they usually do this:
on the server, they create some user session, the
session has a unique number / key
, this key is stuffed into cookies
, everything that needs to be stored for this user is added to the database and hooked to this key
When the user makes a request to the server, you can pull out information by key .
PS: this is about data storage.

K
kazhuravlev, 2014-04-24
@kazhuravlev

But in general - you only need a session ID so that the server understands what kind of client it is, and store everything else where you want. But if the question of storing data on the client has already arisen, then think about it - is it worth considering cookies as such storage? Are you aware that cookies are sent in the clear on every request to the server?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question