(Django) Sharing authentication across two sites that are on different domains

后端 未结 4 1690
你的背包
你的背包 2020-12-24 15:18

I have two sites say foo.com and bar.com and are both Django based. Primary registration occurs on foo.com (I\'d like the main user db to be here) and I\'d like for three th

4条回答
  •  清酒与你
    2020-12-24 15:52

    I think what you are looking for is the SESSION_COOKIE_DOMAIN setting. You would set it like this:

    SESSION_COOKIE_DOMAIN = 'foo.com'
    

    See http://docs.djangoproject.com/en/dev/topics/http/sessions/#session-cookie-domain for more information on that. This does assume that both applications are using the same session storage backend.

提交回复
热议问题