Update session manually

Hello !
So in my project I have the user login with google setup properly and working.
But then the user is redirected to a page where he has to pick one of his projects by selecting it, and I'd like to set the project.id as an additionnalField inside the session.

So the session would store: session, user, projectId

How can I update the session manually from an api endpoint ?
(for example on a POST /api/select-project/{projectId}, the function should setSession key with the projectId value)
Was this page helpful?