How do all of these web platforms provide a long login session that does not require the user to log in again and again?

I really don’t understand: on some platforms there are some kind of “permanent” login sessions. Like Stackoverflow and many other boards and platforms. I registered here a month ago. And even if I completely leave my browser and connect to another Internet, I will return here without login.

I can’t believe that this is simply done using cookies, since cookies are no longer accepted in most modern browsers (they will ask the user and click the instinctive “no”).

I even came across a platform that makes a permanent login, regardless of the browser used. I could use safari or opera. No matter what. I always logged in with my nickname.

Several years have passed since then, and I completely disconnected from web development, I wonder if technology has changed? How is this done today?

+3
source share
6 answers

I can’t believe what I just did with cookies, because cookies are not accepted in most modern browsers (they will ask the user and click the instinctive “no”).

Each main browser accepts cookies by default.

(Another example of the golden rule of rationality: Beliefs are not a substitute for facts.)

+7

cookie - cookie, - . , , , cookie, :

alt text

cookie .

+7

.

+1

... , (, , ), , (, , ), , cookie - , .

+1

, StackOverflow cookie .

0

Cookies

, cookie - - .

PHP cookie.

In php, this is most often done with sessions that, by default, store files on the server in order to track the user and send a cookie header to store cookies in the browser.

Read the zend tutorial for more on this.

Php session-id added to url

You can also do this by adding the session-id to the url instead of using cookies.

ini_set('session.use_cookies', 0) // don't use cookies
0
source

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


All Articles