Is there any option to support guest users with an...
# support-questions-legacy
p
Is there any option to support guest users with an active session and then have them "auth" via passwordless at a later date?
n
Hi @pitchash
You could have an API that simply creates a session for guest users
You would have to handle migrating data to the new account when they eventually login via Passwordless though
p
so this would be plain session management... with no authentication for every user that vists the site.. ?
n
Yep thats correct
p
currently there is also only 1 production environment per account is that right? if i want a seperate set of users i have to create a new super tokens account with a different email?
n
You can email us at team@supertokens.com to add another app for your account. Although it would affect pricing, if you email us we can answer questions about this better
p
ok thanks
n
Happy to help
p
if we have a "guest" user by using the session recipie and no auth.. then the user signs in via passworldless.. what happens with the cookies and the current session?
n
(nevermind)
The passwordless auth API would create a new session for the user
p
so the original session will be "orphaned".. in that the browser will forget all about it.. and on the be it will eventually just disapear?
n
Yep, since the API will respond with new values for the same cookies it would essentially just replace the old session
p
if the user logs out.. the frontend will then presumably call the session auth again... (since we always want a guest or passwordless session)... will this count as a new user in the mau count?
so.. guest.. then login passwordless.. then logout.. how many mau is that?
n
The plain session management functions dont create users, just sessions
Users created by logging in would count towards the MAU count
p
ok.. so sessions dont count for billing?
n
Not as of now no, but Ill double check on this to be sure
p
thanks
n
I was wrong @pitchash , sessions created with unique user ids would count towards billing
So if you dont create a fresh guest session for this user it would be 2 MAUs, otherwise 3
p
im not sure how we would be able to use the same user id..
n
Right so it sort of depends on your setup but theres a few options here. Lets say you create a session with user id
AAA
for a guest user. At some point when you call the passwordless consume code API you could send this user id as part of the request and then on the backend set the guest user id to the session data for the logged in user
Then when you logout, you override the signout logic to do the default first and then create a new session using this guest user id from the session data
This would still mean that each logged in user would account for 2 MAUs though
In your system would guest users be able to perform actions and have data associated with their guest accounts?
p
gues users could build a basket and make payments
n
Right then yeah this is probably the way to go, each user would account for 2 MAUs unfortunately
p
becuase its 2 recipies?
n
Well one user created with the recipe when they log in and another MAU for the session you create for them as a guest user