Can javascript-cookie be set to not sent to the server? -SegmentFault

Source: Internet
Author: User
Some personalized settings are often used in website development and cookie information is required. However, it is found that the cookie information is large and every request must be sent to the server, which is unnecessary, because this information does not need to be processed by the server, it is a waste of resources and there is no need to send each request... some personalized settings are often used in website development and cookie information is required. However, it is found that the cookie information is large and every request must be sent to the server, which is unnecessary, because this information does not need to be processed by the server, it is a waste of resources and there is no need to send so much information to the server each request.

Is there a way to set a cookie that is used only on the browser but not sent to the server?

Reply content:

Some personalized settings are often used in website development and cookie information is required. However, it is found that the cookie information is large and every request must be sent to the server, which is unnecessary, because this information does not need to be processed by the server, it is a waste of resources and there is no need to send so much information to the server each request.

Is there a way to set a cookie that is used only on the browser but not sent to the server?

  • 6 hours ago
  • Comment
  • Reply

Please log on first and then comment

Sort by default

6 answers

The answer is helpful to people and has reference value.1The answer is not helpful. It is a wrong answer.

Adoption

No, so there is a cookie-free statement.

It is only used on the client. You can use localStorage/useData.

You can use local storage to search for local js storage by yourself without using cookies.

What you are talking about is localStorage and sessionStorage.

The browser can disable cookies.

H5 local storage mechanism can be implemented

The cookie does not exist.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.