Friday, 15 April 2011

php - Cookie for subdomain -


I am building a large project with many services, such as game hosting, "YouTube" option, and many more Luggage. Every service has a subdomain, such as kwindu.eu for game hosting, play.kwindu.eu for "youtube" option, pack.kwindu.eu, ....

if you want to log in , Then you are forwarded to Kwindu.eu, you generate a cookie for the login and php script ".kwindu.eu"

Here is the cookie code, I am using :

  setcookie ("logidin", $ session, time () + 86400, "/", ".kwindu.eu");  

It works well with Chrome, if I check cookies, There is a cookie for the EU and everything works fine. But when I try to log in from Firefox or IE, the system only gives me KWU.E. In the form of log in shows.

Try removing the dot: it is:

  setkey ( "Logidin", $ session, time (+ 86400, "/", "kwindu.eu");  

Dot was required to apply the old browser.

See that it works.


No comments:

Post a Comment