# Disable concurrent logins for Basic Auth

**URL:** https://community.plotly.com/t/disable-concurrent-logins-for-basic-auth/69950
**Category:** Dash Python
**Tags:** question
**Created:** [November 16, 2022, 1:34pm UTC](https://community.plotly.com/t/disable-concurrent-logins-for-basic-auth/69950 "2022-11-16T13:34:32Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![jinnyzor](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/jinnyzor/32/21194_2.png) [@jinnyzor](https://community.plotly.com/u/jinnyzor)
#### Post date: [November 16, 2022, 2:30pm UTC](https://community.plotly.com/t/disable-concurrent-logins-for-basic-auth/69950/2 "2022-11-16T14:30:21Z")

</div>

Hello @warrenon,

Welcome to the community!

I dont use the BasicAuth method, I use Flask-Login. With Flask-Login, your user has a session cookie that is tied with their username after logging in.

What you can do is then store the session info along with the username in a database, and then check to make sure that their session is the last active one with their requests. When they log in, you can either have them force the other one off automatically, or prompt them to confirm.

Here is a link to a flow using Flask Login:

> [@Dash App Pages with Flask Login Flow using Flask](https://community.plotly.com/t/dash-app-pages-with-flask-login-flow-using-flask/69507/):
>
> Hello All! I’ve been working to be able to use the Flask method of logging in. This is an alteration of the flask\_login method provided here: [dash-multi-page-app-demos/multi\_page\_flask\_login at main · AnnMarieW/dash-multi-page-app-demos · GitHub](https://github.com/AnnMarieW/dash-multi-page-app-demos/tree/main/multi_page_flask_login) This will allow you to: restrict individual pages and redirect to login while saving the path (note: you will use the registered page name to restrict) once logged in, will redirect to the saved path or to the home page when logging out, it will redi…

For this, you will need to be using Dash Pages, which isnt difficult to implement.

---

_[View the full topic](https://community.plotly.com/t/disable-concurrent-logins-for-basic-auth/69950)._
