What are the Web front-end technologies?What’s the difference between a Cookie and a Session?Cookies and Sessions are common techniques in Web applications that can be used to track a user’s entire Session. But what’s the difference between them?Next thousand front Xiaobian will give you a brief introduction.

The main purpose
Cookie is born to solve the problem that HTTP stateless characteristics can not meet the interactive Web, mainly used for session state management (such as user login status, shopping cart, game scores or other information to record); Personalization Settings (such as user-defined Settings, themes, etc.); Browser behavior tracking (e.g., tracking and analyzing user behavior).
Session is a mechanism used by the server to record the state of the client. It is simpler to use than Cookie, and it also increases the storage pressure of the server accordingly.
If the Cookie mechanism confirms the identity of the customer by checking the “pass” on the customer, then the Session mechanism confirms the identity of the customer by checking the “customer list” on the server. Session is equivalent to a client profile created by the program on the server. When the client visits, it only needs to query the client profile table.
Usage scenarios
Cookie technology can store information in different browsers, and can achieve multiple requests for data sharing, divided into temporary cookies and long-term cookies. If a Cookie has no expiry date set, the browser will delete the Cookie when it is closed. This Cookie is called a temporary Cookie. If a Cookie has an expiration date, then the browser will keep the Cookie until the expiration date. This Cookie is called a persistent Cookie.
Session is a communication state retention mechanism based on Cookie, which can store some information of a user on the server side. After creating a Session, the server returns the Session ID to the browser in the form of Cookie. If the browser is closed, it will carry the Session ID when visiting the server again. When the server finds that the browser brings the Session ID, it will use the corresponding Session in memory to serve it.
What is the relationship between a Cookie and a Session
If a Web front-end programmer is asked “What is the relationship between Cookie and Session?” during an interview, the answer is that both are produced for client-server interaction. Cookie writes the user’s data to the user’s browser, while Session technology writes the user’s data to the user’s own Session. A Session is an object, and its properties can be of any type (cookies can only be set as strings). Cookie is stored in the client side, the disadvantage is easy to forge, not secure, Session is stored in the server side, will consume server resources, Session implementation has two ways: Cookie and URL rewriting.
If you want to know more about cookies and sessions, or want to quickly advance to the front end of the Web, you can choose a major to learn, so that you can learn efficiently and quickly get employed.

The main purpose
Cookie is born to solve the problem that HTTP stateless characteristics can not meet the interactive Web, mainly used for session state management (such as user login status, shopping cart, game scores or other information to record); Personalization Settings (such as user-defined Settings, themes, etc.); Browser behavior tracking (e.g., tracking and analyzing user behavior).
Session is a mechanism used by the server to record the state of the client. It is simpler to use than Cookie, and it also increases the storage pressure of the server accordingly.
If the Cookie mechanism confirms the identity of the customer by checking the “pass” on the customer, then the Session mechanism confirms the identity of the customer by checking the “customer list” on the server. Session is equivalent to a client profile created by the program on the server. When the client visits, it only needs to query the client profile table.
Usage scenarios
Cookie technology can store information in different browsers, and can achieve multiple requests for data sharing, divided into temporary cookies and long-term cookies. If a Cookie has no expiry date set, the browser will delete the Cookie when it is closed. This Cookie is called a temporary Cookie. If a Cookie has an expiration date, then the browser will keep the Cookie until the expiration date. This Cookie is called a persistent Cookie.
Session is a communication state retention mechanism based on Cookie, which can store some information of a user on the server side. After creating a Session, the server returns the Session ID to the browser in the form of Cookie. If the browser is closed, it will carry the Session ID when visiting the server again. When the server finds that the browser brings the Session ID, it will use the corresponding Session in memory to serve it.
What is the relationship between a Cookie and a Session
If a Web front-end programmer is asked “What is the relationship between Cookie and Session?” during an interview, the answer is that both are produced for client-server interaction. Cookie writes the user’s data to the user’s browser, while Session technology writes the user’s data to the user’s own Session. A Session is an object, and its properties can be of any type (cookies can only be set as strings). Cookie is stored in the client side, the disadvantage is easy to forge, not secure, Session is stored in the server side, will consume server resources, Session implementation has two ways: Cookie and URL rewriting.
If you want to know more about cookies and sessions, or want to quickly advance to the front end of the Web, you can choose a major to learn, so that you can learn efficiently and quickly get employed.
Read More:
- Some uncommon problems and solutions of cookie
- Illegalargumentexception: control character in cookie value or attribute tomcat7
- Three ways of adding cookie by scratch
- Illegalargumentexception error when adding cookie to response
- Program RPC 1726 error tracking
- If the iframe in IE refers to the cross domain site page, the session fails
- HTTP error 401 and 403 detailed explanation and solution
- Shiro deserialization vulnerability replication (cve-2016-4437)
- 451 4.7.0 temporary server error. Please try again later. Prx5
- Parsing the exception of storing JSON string in cookie
- Ie8.0 reports Oracle error 1403 error after logging into Oracle EBS
- Mongodb connection authentication auth failed solution
- Oracle error collection solution
- Handling of expression not in group by key [value] reported by hive on October 12, 2020
- session_ start(): open(SESSION_ FILE, O_ Rdwr)) failed: processing of permission denied (13)
- Exception ignored in: bound method basesession__ del__ Of
- Socket error 10053
- CHECK_NRPE: Error – Could not complete SSL handshake.
- Error 403 Forbidden when using WGet or curl
- To solve the problem of failed to load: data in HTML5 game running rmmv locally/ actors.json problem