Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 378413
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T14:47:27+00:00 2026-05-12T14:47:27+00:00

I want to let the same user session span across: site.com sub1.site.com sub2.site.com I

  • 0

I want to let the same user session span across:

  • site.com
  • sub1.site.com
  • sub2.site.com

I got this to work in production by setting SESSION_COOKIE_DOMAIN to ".site.com", but it doesn’t work for me on localhost/dev servers. How do you get it to work for localhost sub-domains? When I change the SESSION_COOKIE_DOMAIN on the dev server to the production website domain or ".localhost", django auth logins completely stop working (I’m unable to ever login, no cookie is created on localhost).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T14:47:27+00:00Added an answer on May 12, 2026 at 2:47 pm

    I think I got a workaround solution, but couldn’t use localhost. I could only get it working for a test “.com” domain that maps to 127.0.0.1.

    In my /etc/hosts file (on OSX:)

        127.0.0.1  test.com
        127.0.0.1  sub1.test.com
        127.0.0.1  sub2.test.com

    Then on my development settings.py:

        SESSION_COOKIE_DOMAIN=".test.com"
    

    I could not get this working with plain “localhost”, it seemed I needed the “.com” string in there to get it working. So then I could login and have cross subdomain auth cookies using sub1.test.com:8000 and sub2.test.com:8000 in my browser.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to let the user draw on an image in a browser. In
When a user logs in on our website, I want to change the session
In my application,I do not want two user login with the same login name.
Let's say I have a Model, for example User, and I want to merge
<property name=netbeans.user value=${user.home}/.foo/> <property name=derby.system.home value=netbeans.user> I want derby.system.home property to be the same
I want to let users specify a date that may or may not include
I want to let the users of my app, which is in turn an
It seems pretty common to want to let your javascript know a particular dom
If I have a property that I want to let inheritors write to, but
I have a large amount of text in a UITextView. I want to let

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.