H
H
hckn2018-09-14 21:02:21
JavaScript
hckn, 2018-09-14 21:02:21

How to logout with httpOnly cookies?

httpOnly cookies cannot be deleted on the client, only by a request to the server.
And how then to do a logout if the user, for example, pressed the logout button while being offline?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ilya Loginov, 2018-09-14
@hckn

You can create regular cookies in which you will store the login=1 field, which you can safely delete offline and give the user an authorization page the next time the server is accessed. Also, in cases of XSS attacks, the maximum that can be done is to log out the user.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question