User logon with invalid setcookie under IE
Login. php
setcookie("YP_account",$account,(time()+3600),"/",".yourone.cn");setcookie("YP_userid",$userid,(time()+3600),"/",".yourone.cn");setcookie("YP_type",$type,(time()+3600),"/",".yourone.cn");
Jump to index. php after setting cookie
print_r($_COOKIE);
The returned null value is the cookie set on the login. php page.
Excuse me, what's wrong with this question?
It's okay if I use two virtual domain names locally.
The above code is put on the Internet server for testing.
Note: The same code has no problem under FF.
Reply to discussion (solution)
Output before setcook ??
Are the two pages different in time? // This is less likely
Does ie reject cookies?
Add one sentence
Header ('p3p: CP = "CURa ADMa DEVa PSAo PSDo our bus uni pur int dem sta pre com nav otc noi dsp cor "');
I have 2 domain names now
Http://test1.yourone.cn/
Http://test2.yourone.cn/
Login. php under test2
$ Account = $ _ POST ['username']; $ password = $ _ POST ['password']; $ rs = curlApp ('http: // test1.yourone.cn/index.php? A = webLogin & m = Login & g = Home & act = 1 & username = '. $ account. '& password = '. $ password); $ rsarr = explode ("|", $ rs); if ($ rsarr [0]! = "" & $ Rsarr [0] = "OK") {$ account = $ rsarr [1]; $ userid = $ rsarr [2]; $ type = $ rsarr [3]; setcookie ("YP_account", $ account, (time () + 3600), "/", ".yourone.cn "); setcookie ("YP_userid", $ userid, (time () + 3600), "/", ".yourone.cn"); setcookie ("YP_type", $ type, (time () + 3600), "/", ".yourone.cn"); $ js-> alertWithRelocate ("logon successful ",".. /index. php ");} else {$ js-> alertWithBack ($ rs );}
Use a curl request to obtain the verification result from the verification under test1 and return the logon information.
The verification result is echo "OK | $ account | $ userid | $ type ";
Set the cookie under test2 for obtaining information
When I log on to test2 and set the cookie under this domain name, do I not need header p3p?
What I need to achieve is
If test1 has a logon cookie information after successful login, call test2 and test3 to set the cookie page.
If test2 has logon cookie information after successful login, Call test1 and test3 to set the cookie page.
If test3 has a logon cookie after successful logon, Call test1 and test2 to set the cookie page.
The code is as follows:
In test1
In test2
In test3
FF functions are implemented, but IE does not work.
For example, test2 test3 fails to be set for all cookies on test1.