Javascript-cookie can be set to not send to the server ah? -Segmentfault

Source: Internet
Author: User
Keywords Php javascript
In the development of the Web site often use some personalized settings, need to use cookies to record information, but found that the cookie information is very large, each request to send to the server, feel unnecessary, because this information is not required to process the server, so it feels very wasteful resources, There's no need to ask for so much information every time you request a server.

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

Reply content:

In the development of the Web site often use some personalized settings, need to use cookies to record information, but found that the cookie information is very large, each request to send to the server, feel unnecessary, because this information is not required to process the server, so it feels very wasteful resources, There's no need to ask for so much information every time you request a server.

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

    • Asked 6 hours ago
    • Comments
    • Invitation to answer

Please login and comment first

Sort By default sorting time

6 answers

The answer is helpful to the person, has the reference value 1 The answer is no help, it's the wrong answer, irrelevantly replying .

Adopted

It's not going to work, so there's cookie-free to say.

Used only on the client, you can use Localstorage/usedata Bar

With local storage Bai, search their own JS local storage on the line, do not need to use cookies

What you say is called Localstorage and Sessionstorage.

Browser can disable cookies

H5 's local storage mechanism enables

There is no cookie in it.

  • 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.