Differences between cookie setting in IE and FirefoxPHP

Source: Internet
Author: User
Use cookies to log on to the website. After debugging, use setcookie (username, username, time () + 1000,/php100/) to store user login information, then use setcookie (username, time ()-3600); to exit. there is no problem in testing in IE. As a website

Use cookies to log on to the website. After debugging, use
Setcookie ("username", "username", time () + 1000, "/php100 /");
To store user login information, and then use
Setcookie ("username", "", time ()-3600 );
Exit. there is no problem in testing in IE. As a website, you must be compatible with as many browsers as possible. As a result, it was normal to log on to Firefox and encountered problems when it was launched. The user is always logged on. So I checked the differences between cookie Records in IE and Firefox. after testing, I suddenly realized.
If the fourth parameter (valid path parameter) of setcookie () is not specified, the current directory is used as the valid path by default, and the path I tested is: http: // 127.0.0.1/php/rss2fla/data/log. php. Therefore, the cookie paths set during login and exit are different.
IE is more user-friendly than Firefox. haha, when a path is specified, it will overwrite the Cookie variable of the same name under the current IP address, while FireFox is more strict, resulting in a new variable ......
I feel that monopoly is not a disadvantage in some aspects. if I use IE as a browser, I don't have to worry about it ...... Haha ......

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.