https://linen.dev logo
Best practice for login logout session
# 🖥│support-forum
b
Hi, I've successfully connected to Composio, but I need some feature like session management for users to login/logout. Do I just delete the connected account when log out ?
a
Hey Ben! I'd recommend against using connections for session management. Re-authenticating each time would add unnecessary overhead for your users. A better approach would be to handle sessions separately on your end (e.g., using JWT). Keep the Composio connection independent from your login/logout flow—authenticate with Composio once, then manage user sessions through your own system.
b
Okay, i got it, thank you
Oh, and I have 1 more question. Is the access token in Composio: 1. In the background, Composio will refresh whenever it expires Or 2. Lazy trigger ? Only when I use a tool, it checks for access token expiry then refresh if expired
a
we will refresh on a periodic basis irrespective of when you use the tool.
b
refresh_token does expires too ( for e.g 90+ days), and do we need to reconnect?
a
this depends on toolkit, for some toolkits like Snowflake its configurable. If that expires then user need to re-auth.