#Client-side session revalidation

10 messages ยท Page 1 of 1 (latest)

versed robinBOT
#

๐Ÿ”Ž This post has been indexed in our web forum and will be seen by search engines so other users can find it outside Discord

๐Ÿ•ต๏ธ Your user profile is private by default and won't be visible to users outside Discord, if you want to be visible in the web forum you can add the "Public Profile" role in id:customize

โœ… You can mark a message as the answer for your post with Right click -> Apps -> Mark Solution
(if you don't see the option, try refreshing Discord with Ctrl + R)

cerulean comet
#

One solution would be to use JWT as auth method. That will sign a json object, that is saved on the client. The client can't modify it, but you can access it everywhere (serverside & clientside). Because it's handled clientside, you don't need to request your server nor your data source. You can just ask the client what the saved values are ๐Ÿ‘

harsh flax
#

You could store the user id in the cookies and add a expiration date to it upon logging in.

#

And when the user goes to a page, check if the cookie is valid/not expired. if it IS expires, reroute the user to a login page or something (use your imagination)

pulsar rapids
#

I think storing user id in a cookie without any encryption is not really safe and easy to manipulate, isnt it?

harsh flax
#

No worries! good luck.

cerulean comet
#

Sure thing. Please mark solution

versed robinBOT
#
โœ… Success!

This question has been marked as answered! If you have any other questions, feel free to create another post

Jump to answer
cerulean comet