简体   繁体   中英

How does Quora load two different webpages on the same URL

If you visit https://quora.com , but don't have a Quora account, you will see a login/sign up page. However, if you visit the same url. but do have an account, you will see your feed. What code does Quora use to show two different webpages on the same URL?

The account information is stored in the browser's cookies. When making a request to https://quora.com , the browser sends those cookies to the server. The server determinates based on the values in the cookies if the user is logged in or not.

The answer to your question "What code does Quora use to show different versions of the same URL" cannot be inferred solely from the response, it could be anything that is run privately on their servers.

You should check out how cookies work for instance here: https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM