dqg63264 2015-03-17 12:04
浏览 14
已采纳

子域名的Cookie

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.

  • 写回答

1条回答 默认 最新

  • doushan1863 2015-03-17 12:09
    关注

    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.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 Pwm双极模式H桥驱动控制电机
  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题