Answer the question
In order to leave comments, you need to log in
What is the best way to write user_id in Cookie?
I have a database and it has a user_id line
And it is written in Cookies, that is, it determines whether a person is authorized or not. But I still need a user_id to access the Database through it, and if a person changes the user_id in Cookies, what should I do then?
Answer the question
In order to leave comments, you need to log in
Either sign the cookie or store the user_id in the session.
Well, use httpOnly for this cookie
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question