5

It's really confusing me and I don't understand why. I have database backed sessions (with mongoengine) but it seems like when I visit a page then refresh it the user is no longer logged in. Essentially

request.user.is_authenticated() 

is False after the page reset

Anyone have any ideas? In my settings I have:

SESSION_ENGINE = 'mongoengine.django.sessions'

MIDDLEWARE_CLASSES = (
...
'django.contrib.sessions.middleware.SessionMiddleware',
...

On the debug page I notice a few things:

SESSION_COOKIE_DOMAIN   None  
SESSION_EXPIRE_AT_BROWSER_CLOSE  False
SESSION_COOKIE_AGE  1209600

Could the absent cookie domain be a clue as towards what the problem is?

Jared Joke
  • 1,226
  • 2
  • 18
  • 29
  • Can you share with us the code of the view where you have the problem?, maybe the problem is there. – Leonardo Feb 28 '14 at 23:08
  • Hello, can you share your user authentication controller? Are you setting your session expiring age? Here is an example on how to set the auth controller: http://stackoverflow.com/a/22940264/955183 – André Teixeira Apr 14 '14 at 22:35

0 Answers0