J
J
Junior2018-05-11 19:45:15
PHP
Junior, 2018-05-11 19:45:15

Which is better to use to authorize users cookie or session?

When creating authorization on the site, the question arose whether it is better to use sessions or cookies

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey Sokolov, 2018-05-11
@IT-Programmer

Sessions are most often held on cookies: with each request, the browser passes a cookie with the session ID, and php pulls out of its storage - files, Redis, database, as you wish - session data for this id.
Those. the difference is where to store the session data itself: on the server or on the client.
Everything that comes from the client can be faked. Therefore it is better to use sessions.

D
Dmitry Kim, 2018-05-11
@kimono

Usually these are related things. Otherwise, how do you determine which session a given user belongs to? Unless, of course, php-session-trans-id is used.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question