Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

logout #1

Open
mindscratch opened this issue Oct 31, 2017 · 2 comments
Open

logout #1

mindscratch opened this issue Oct 31, 2017 · 2 comments

Comments

@mindscratch
Copy link

How might I logout a user?

@vektah
Copy link
Contributor

vektah commented Oct 31, 2017

https://stackoverflow.com/questions/233507/how-to-log-out-user-from-web-site-using-basic-authentication

Basic Authentication wasn't designed to manage logging out. You can do it, but not completely automatically.

What you have to do is have the user click a logout link, and send a ‘401 Unauthorized’ in response, using the same realm and at the same URL folder level as the normal 401 you send requesting a login.

to be honest if you want logout you probably should add session/cookie based auth instead.

@mindscratch
Copy link
Author

That's interesting, I'll give it a shot. I was wondering, because it seems browser might cache something? When I access the site with basic auth, the first time I enter username/password, then it no longer prompts until I clear browser cache or use a "private" browser window.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants