HTTP Cookie header in Set-cookie format

Source: Internet
Author: User
Tags http cookie setcookie

Cookie-related HTTP headers

there are two HTTP headers and cookies about: Set-cookie and cookies. Set-cookie is sent by the server, which is included in the header of the response request. It is used to create a cookie on the clientThe cookie header is sent by the client and is included in the header of the HTTP request. Note that only the domain and path of the cookie match the requested URL to send this cookie.
Set-cookie Headerthe format of the Set-cookie response header is as follows:
Set-cookie: <name>=<value>[; <name>=<value>] ...[; expires=<date>][; Domain=<domain_name>][; path=<some_path>][; secure][; HttpOnly]
Expires=<date>: Sets the period of validity of the cookie, which expires if the cookie exceeds the date indicated by date. If this option is not set, then the cookie will expire when the browser is closed. Note: Date is Greenwich mean GMT (GMT) and is expressed in the following format:                       
Day, DD MMM YYYY HH:MM:SS GMT Day of the                            the week (Sun, Mon, Tue, Wed, Thu, Fri, Sat).                        DD the day in the month (such as to the first day of the                            month).                        MMM the                            three-letter abbreviation for the month (Jan, Feb, Mar, APR, May, June, Jul, Mar, Sep, Oct, Nov, Dec).                        YYYY the year                            .                        HH                            The hour value in military time (would is 10:00am, for example).                        MM the                            minute value.                        SS the                            second value.


domain=<domain_name>:Path=<some_path>:Note: Temporary cookies (cookies without expires parameters) cannot be accompanied by the domain option. when a client sends an HTTP request, a valid cookie is sent to the server along with it. if the domain and path parameters of a cookie match the URL, the cookie is valid.

A URL contains domain and path, you can refer to the http://www.w3school.com.cn/html/html_url.asp


Secure: Indicates that the cookie can only be sent to the HTTP server. HttpOnly: Indicates that the cookie cannot be obtained by client script.

HTTP Cookie header in Set-cookie format

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.