# django admin panel autologout.

**URL:** <https://forum.djangoproject.com/t/django-admin-panel-autologout/27621>\
**Category:** The Admin\
**Created:** [January 31, 2024, 12:24pm UTC](https://forum.djangoproject.com/t/django-admin-panel-autologout/27621 "2024-01-31T12:24:48Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![nmatal1](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/nmatal1/32/18659_2.png) [@nmatal1](https://forum.djangoproject.com/u/nmatal1)\
**Post date:** [January 31, 2024, 12:24pm UTC](https://forum.djangoproject.com/t/django-admin-panel-autologout/27621/1 "2024-01-31T12:24:48Z")

</div>

when i am trying to hard reload by pressing ctrl+shift+R my session is automatically logging off.

please tell me how django session are working behind the scene.

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [January 31, 2024, 12:34pm UTC](https://forum.djangoproject.com/t/django-admin-panel-autologout/27621/4 "2024-01-31T12:34:14Z")

</div>

It doesn’t behave that way for me.

Sessions are (normally) a cookie named `sessionid` that are passed back and forth for each request and response. As long as the same cookie is being exchanged, you’ll remain logged in.

I’d look at the Network tab in your browser’s developer tools to see what cookies are being exchanged for each request.

---

<div class="post-metadata">

**Author:** ![nmatal1](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/nmatal1/32/18659_2.png) [@nmatal1](https://forum.djangoproject.com/u/nmatal1)\
**Post date:** [January 31, 2024, 12:40pm UTC](https://forum.djangoproject.com/t/django-admin-panel-autologout/27621/5 "2024-01-31T12:40:53Z")

</div>

how to check m using same cookie?  
because in the browser i am able to login. but i am hard reloading the page then cookies get cleared and it is throwing me on login page.

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [January 31, 2024, 12:49pm UTC](https://forum.djangoproject.com/t/django-admin-panel-autologout/27621/6 "2024-01-31T12:49:37Z")

</div>

> [@KenWhitesell](#):
>
> I’d look at the Network tab in your browser’s developer tools to see what cookies are being exchanged for each request.

In the Request Headers, you’ll see a line for `Cookie:`, and in the Response Headers you’ll see a line for `Set-Cookie`

When you submit your credentials, you’re issuing a POST request to your login view. That response contains the `sessionid` cookie. Your browser should then be returning that same cookie on all subsequent requests.

Are you working with the standard login view, or are you using a modified view? If you’re using a modified view, you might be doing something wrong.

---

<div class="post-metadata">

**Author:** ![nmatal1](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/nmatal1/32/18659_2.png) [@nmatal1](https://forum.djangoproject.com/u/nmatal1)\
**Post date:** [February 1, 2024, 7:07am UTC](https://forum.djangoproject.com/t/django-admin-panel-autologout/27621/7 "2024-02-01T07:07:00Z")

</div>

i am using django dbrouters to route through my databases. during the switch of db my application is getting logout.

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [February 1, 2024, 1:03pm UTC](https://forum.djangoproject.com/t/django-admin-panel-autologout/27621/8 "2024-02-01T13:03:38Z")

</div>

Ok, that explains a lot, if you’re trying to route access to the sessions model. You don’t want to route access to _it_, you want all references to it to remain in the default database.
