nano icon indicating copy to clipboard operation
nano copied to clipboard

Lougout from couchdb after getting the Auth cookie

Open limoragni opened this issue 10 years ago • 4 comments

This is pretty basic but I couldn't find how to do it. After doing the authentication as shown here https://github.com/dscape/nano#using-cookie-authentication is there a way of logout that user invalidating the key? If not I would like to contribute adding a method to do that, but I would need some pointers.

limoragni avatar Dec 30 '15 17:12 limoragni

There is no such thing like a session id which one can invalidate. Just throw away the cookie. The session id is just a hash over username, salt, secret and a timestamp.

jo avatar Dec 30 '15 17:12 jo

Ok, I think throwing the cookie away may be enough for my case. But it might be useful to have a method to delete the session from couchdb as stated here: https://wiki.apache.org/couchdb/Session_API#Log_out

limoragni avatar Dec 30 '15 18:12 limoragni

Basically a DELETE _session just answers with a header that instructs the client to discard the session cookie. Do you use nano in the browser?

jo avatar Dec 30 '15 18:12 jo

It seems that this issue has been answered and could be closed. If so, could you close it?

carlosduclos avatar Mar 17 '17 13:03 carlosduclos