lucia-auth / lucia

Authentication, simple and clean
https://lucia-auth.com
MIT License
8.42k stars 449 forks source link

[Docs]: is there a way to make Lucia share sessions across sub domains #1446

Closed firstaxel closed 4 months ago

firstaxel commented 4 months ago

Description

Please can you give a guide on how to configure Lucia to share the auth session across subdomain so I can use it for multiple apps

pilcrowOnPaper commented 4 months ago

Use the sessionCookie configuration to add a domain attribute to the session cookie

https://lucia-auth.com/basics/configuration#sessioncookie

https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies#domain_attributes