开发者

What is the correct value for SESSION_COOKIE_DOMAIN if my Django site is set up on a subdomain?

I have constant problem with cookies on my Django site which is set up on a subdomain. It works for a couple of days, then message 'your browser doesn't accept cookies' appears on a login page. I need to restart my web server to make it work for a couple of next days and this cycle repeats.

This is really frustrating. I am not sure what am I doing wrong. I suspect that SESSION_COOKIE_DOMAIN might be set to a wrong value. What is the proper way to set it?

  1. SESSION_COOKIE_DOMAIN = 'subdomain.domain.com'
  2. SESSION_COOKIE_DOMAIN = '.domain.com'
  3. SESSION_COOKIE_DOMAIN = ''
  4. other?

Any help is appreciated. It behaves ver开发者_开发知识库y strange for me (I mean that everything works after web server is restarted...). Maybe the problem lies in configuration of web server?


Looks like:

SESSION_COOKIE_DOMAIN = 'domain.com'

solved the problem.

Hope this helps someone.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜