'Set login session for sub domain from main domain in Django

I have a main domain example.com and a subdomain tenant.example.com. A user comes to http://example.com/login and logs In, By default, Django set a session cookie for example.com.

What I want is that Django set the session cookie for tenant.example.com instead of example.com.

How can I implement this?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source