0

I´m building a big project with many services, like Game Hosting, "YouTube" alternative, and many other stuff. Every service has subdomain, like kwindu.eu for GameHosting, play.kwindu.eu for "YouTube" alternative, pack.kwindu.eu,....

If you want to log in, you are forwarded to kwindu.eu, then you log in and php script generate cookie for ".kwindu.eu"

Here is the cookie code, I´m using:

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

This works good with chrome, if i check cookies there is a cookie for kwindu.eu and everything works fine. But when i try to login with Firefox or IE, system show me as loged in only at kwindu.eu.

2
  • This is wierd. I'm using Firefox and tried your method, and it works for me. Are you sure there isnt any other issue?
    – Eda190
    Mar 17, 2015 at 12:09
  • Yea it was in php code that should check e-mail. It messed it up, it is working now.
    – Slouchy
    Mar 17, 2015 at 14:14

1 Answer 1

1

Try removing the dot. That is:

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

The dot was required for older browsers implementing this RFC.

See if that works.

7
  • What do you see in Firebug? Is the cookie set correctly? This will help troubleshoot further
    – sg-
    Mar 17, 2015 at 12:26
  • But web like ignoring it. Web showing login button.
    – Slouchy
    Mar 17, 2015 at 13:04
  • If i try to echo it by php it is showing cookie fine.
    – Slouchy
    Mar 17, 2015 at 13:05
  • And php is succesfully connected to DB.
    – Slouchy
    Mar 17, 2015 at 13:07
  • It looks there is problem with changing session in DB. It is using old one.
    – Slouchy
    Mar 17, 2015 at 13:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.