1

I have 2 app in one django project. I allow two Domain(e.g. aaa.com & bbb.com) to access my django project. (Actually, aaa.com to app A, bbb.com to app B). (There is some reasons that I want to create 2 app in 1 project.)

And I want to set different SESSION_COOKIE_AGE for these 2 domains. So I'm thinking about these solutions...


(Solution A)

aaa.com - SESSION_COOKIE_AGE = 10 (domain & age are just an example)

bbb.com - SESSION_COOKIE_AGE = 20

or

(Solution B)

App A - SESSION_COOKIE_AGE = 10

App B - SESSION_COOKIE_AGE = 20

Is django support it?


If NOT, Since I use this code to create a cookies in views.py for App A,

request.session._get_or_create_session_key()
request.session.modified = True

Can I specific cookies age in views.py which overwrite the setting in settings.py?

I'm using django 2.0.2

Thanks!

user3114168
  • 325
  • 1
  • 3
  • 14
  • take a look here https://stackoverflow.com/questions/2116860/django-session-cookie-domain-with-multiple-domains – Lemayzeur May 01 '18 at 16:16

0 Answers0