How to differentiate cookies with the same name

Source: Internet
Author: User
How to differentiate cookies with the same name? if it is ASP & nbsp; I will write it into: response. cookies (cookies_name) (admin) read: request. cookie (cookies_name) (admin) without cookies_name, may cause mixing of cookies on multiple sites on my computer. logging on to A is equivalent to logging on to BPHP, and I only find and read: $ How to differentiate cookies with the same name
If it is ASP, I will write

Write:
Response. cookies (cookies_name) ("admin ")
Read:
Request. cookies (cookies_name) ("admin ")

If cookies_name is not added, it may cause mixing of Cookies on multiple sites on my computer. logon to A equals to logon to B.

Php I only found

Read:
$ _ COOKIE ["admin"]

PHP needs to be written in the same way as ASP

Share: More


------ Solution --------------------
Cookies (cookies_name) ("admin") in ASP are called hierarchical cookies.

PHP is not so complex (because php supports joined key arrays, but asp does not)
Write setcookie ('Cookies _ name [admin] ', 'value ')
Read $ _ COOKIE ['Cookies _ name'] ['admin']

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.