activeOrganizationId stays null after setActiveOrganization
Creating org + setting as active works, but session.activeOrganizationId remains null on next request.
Create org:
20 Replies
If you check the DB right after setActiveOrg was called, does the activeOrganizationId say it's true for that session?
I still get null :(
The db has the right activeorgid when I query it directly, but getsession() still gives me null.
Solution
Do you use cookie cache?
yea
ohh that's whyy
😄
but shouldn't the session be updated automatically after creating the org?
Client doesn't know when something is updated on the server
Just refresh the session and that's all
Even after refreshing the session on the client side with disablecookiecache: true, the activeorgid still returns null :( @Ping
Show your code
^^
Are you sure you're fetching the session after the active org was set?
yup
Is cache cookie changed when you refresh the session?
lemme check
__Secure-domain.session_data cookie did update
In the cookie
only onboarding got set to true activeorgid stayed the same
Onboarding is updated, but active org is not?
yeaa
Really weird. I thought the problem was cookie cache as it's kinda buggy, but well
What if you set active organization manually after creation
lemme try that