所有這些網絡平台如何實現不需要用戶反复登錄的長時間登錄會話? (How do all these web platforms achieve a long-time login session that does not require the user to login over and over again?)


問題描述

所有這些網絡平台如何實現不需要用戶反复登錄的長時間登錄會話? (How do all these web platforms achieve a long-time login session that does not require the user to login over and over again?)

I really don't get that: Some platforms have some kind of "persistent" login sessions. Like Stackoverflow and many other boards and platforms. I've logged in here a month ago. And even if I quit my browser totally and have another internet connection with different IP, I come back here with no login.

I can't belief that's just done with cookies, since cookies are not accepted in most modern browsers anymore (they would ask the user and the click instinctive "no").

I even encountered a platform that does persistent login regardless of the browser I use. I could use safari, or opera. No matter what. I was always logged in with my nick.

Since a few years have passed since that and I went totally off from web development, I wonder if technologies have changed? How is that done today?


參考解法

方法 1:

  

I can't belief[sic] that's just done with   cookies, since cookies are not   accepted in most modern browsers   anymore (they would ask the user and   the click instinctive "no").

Every major browser accepts cookies by default.

(Just another example of the golden rule of rationality: Beliefs do not substitute facts.)

方法 2:

Most browsers are configured to accept first-party cookies by default - these are cookies supplied by a website for the same domain. However, a third party cookie, one sent by one site, but destined to be used on another, will often be rejected or pop open a confirmation dialog.

So the answer is, yes, it is cookie!

There's some interesting graphs here showing the percentage of visitors to one site who have various forms of cookie filtering enabled, broken down by browser:

The same site also has a summary of the capabilities and defaults for cookie handling in the major browsers.

方法 3:

Cookies make the world go round.

方法 4:

so... it seems you have your answer (or at least part of it), but I thought I'd add the detail (though I suspect you already know this), that you can set a cookie to expire at some point in the distant future, effectively making it permanent. 

方法 5:

You can easily check that StackOverflow stores cookies in your browser.

(by ThanksphihagPaul DixonRobin DayYevgeny Simkinesycat)

參考文件

  1. How do all these web platforms achieve a long-time login session that does not require the user to login over and over again? (CC BY-SA 3.0/4.0)

#login #persistence #PHP #session






相關問題

只允許 oracle db 登錄到特定的應用程序? (Allowing oracle db login only to specific application?)

使用 FB.login 的註冊流程 (Registration flow using FB.login)

asp.net c# sistem login (asp.net c# login system)

Rails 設計登錄不工作 (Rails devise sign in not working)

我在 cakephp 2.4 中遇到了登錄頁面 (I'm getting stuck with login page in cakephp 2.4)

如何刪除特定用戶的會話登錄 (How to remove session login for specific user)

有沒有標準的asp.net認證授權登錄系統? (Is there a standard asp.net authentication authorization login system?)

所有這些網絡平台如何實現不需要用戶反复登錄的長時間登錄會話? (How do all these web platforms achieve a long-time login session that does not require the user to login over and over again?)

Util-Linux 登錄不使用影子密碼 (Util-Linux Login not working with shadow password)

Android Webview Facebook 登錄 (Android Webview Facebook Login)

重置 Bookstack 憑據 (Reset Bookstack Credentials)

輸入正確的詳細信息且未顯示錯誤後,登錄頁面未重定向到 index.php (Login in page not redirecting to index.php after entering correct details with no error displayed)







留言討論