# 🚀 Hey Streamlit Fam! Let's Talk User Session Management!

**URL:** <https://discuss.streamlit.io/t/hey-streamlit-fam-lets-talk-user-session-management/65064>\
**Category:** Using Streamlit\
**Tags:** discussion\
**Created:** [March 19, 2024, 12:34pm UTC](https://discuss.streamlit.io/t/hey-streamlit-fam-lets-talk-user-session-management/65064 "2024-03-19T12:34:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![TomJohn](https://sea2.discourse-cdn.com/streamlit/user_avatar/discuss.streamlit.io/tomjohn/32/19953_2.png) [@TomJohn](https://discuss.streamlit.io/u/TomJohn)\
**Post date:** [March 19, 2024, 12:34pm UTC](https://discuss.streamlit.io/t/hey-streamlit-fam-lets-talk-user-session-management/65064/1 "2024-03-19T12:34:50Z")

</div>

Hi All!

As we all know, Streamlit is on fire 🔥 for building and deploying awesome data apps. But there’s something missing that could really amp up its game, especially for people wanting to use streamlit in the corporate enviorment.

Yep, we’re talking about session management 🙂 Picture this: you’re all pumped to roll out your Streamlit app in your company. But then, the dreaded corporate audit comes knocking, and guess what? They’re not too thrilled about the lack of session limits and control over session length. Of course you can try to write your own custom session managment control, however it would be muuuch simpler to have some standard best-practice-functionalities “in the box”.

Imagine being able to:

1. Keep a lid on the number of simultaneous sessions per user to keep things running smooth, snappy and more secure!
2. Set session timers to ensure security and stick to corporate policies.
3. Get all the juicy details for audits with insights into who’s doing what and when.

With these session management features, Streamlit could be the MVP for corporate deployments. We’re talking about winning hearts (and audits) left and right 🙂

**So, Streamlit Crew, are there any plans regarding user session managment? I have gone through a number of community posts and there does not seem to be a standard approach. How can community help?**

Best,  
Tom

---

<div class="post-metadata">

**Author:** ![TomJohn](https://sea2.discourse-cdn.com/streamlit/user_avatar/discuss.streamlit.io/tomjohn/32/19953_2.png) [@TomJohn](https://discuss.streamlit.io/u/TomJohn)\
**Post date:** [April 5, 2024, 3:20pm UTC](https://discuss.streamlit.io/t/hey-streamlit-fam-lets-talk-user-session-management/65064/2 "2024-04-05T15:20:46Z")

</div>

As my research continues, I have found one simple solution to ensure that each user can have only one session open at a time. Opening a new session for the same user, such as in a new tab, will expire the previous session.

> [@Right way to manage same user opening multiple sessions](https://discuss.streamlit.io/t/right-way-to-manage-same-user-opening-multiple-sessions/25608/3):
>
> Hi again @randyzwitch ! Thanks for your explanation and for nudging me in what I think is the right direction, appreciate it. Sharing below a solution that combines (1) session tokens and (2) st.experimental\_singleton in order to expire any old sessions for a given user - whenever that user opens a new session. Follow-up question: This seems to work locally even across browsers, but would this work when deployed? Am i missing anything that should be obvious? Also if you or anyone else have id…

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/streamlit/original/3X/c/f/cf4c2ee0d938358f82448c5fe4b9c3c91d7ce19c.svg) [@system](https://discuss.streamlit.io/u/system)\
**Post date:** [October 2, 2024, 3:21pm UTC](https://discuss.streamlit.io/t/hey-streamlit-fam-lets-talk-user-session-management/65064/3 "2024-10-02T15:21:02Z")

</div>

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
