Cache client side data in uplink server code

I was wondering if I could somehow store some client specific data in server side code until the client terminates.

as an example (not the only reason I would use it, but it is a simple one):
I use external database and user management is part of this database. I use an uplink server to connect the database with anvil client.

I would store the active user (logged in user) in the server side, right after a successful login, instead of passing it every time to server code, when I need some user related data. However, this data is client specific. It depends on the client’s session. Multiple user, multiple session would login in by multiple users, so the server should know and store/cache user data by session.

How could I access data by client session in server code?

I’m sure it is somewhere in the doc, I’ve just missed it…

Hi @attila

Are you looking for anvil.server.session?

1 Like

Hi @meredydd !
Yes that is what I was looking for!

Thanks!

2 posts were split to a new topic: Anvil.server.session in uplink code