sessions icon indicating copy to clipboard operation
sessions copied to clipboard

Deleting session from the redis db!

Open unreadable opened this issue 7 years ago • 5 comments

Is there a way to delete the session of the user after it's no longer needed? I've tried session.Clear(), but it still leaves the session id in the database. Could this be fixed?

unreadable avatar Jul 23 '17 10:07 unreadable

have you call session.Save() after Clear()?

ghiewa avatar Jul 25 '17 07:07 ghiewa

No, I haven't so far, but doesn't seem to dial the database. Also I've notice that the session data isn't kept in the database, it only stores the session id without any data..

unreadable avatar Jul 25 '17 09:07 unreadable

post your code here

ghiewa avatar Jul 25 '17 14:07 ghiewa

I can't right now. Also, if the session data is not gonna be kept in the database, why isn't c.Keys used to store data?? This package is based on gorilla context which should be replaced with request.Context or c.Keys for saving the data...

unreadable avatar Jul 25 '17 14:07 unreadable

Hi,

Seems old but @unreadable were you able to fix this issue? I don't see a method to delete the session key stored on Redis.

Even though the session.Delete() & session.clear() does invalidating the session but there needs to be a cleaner way to remove the session key from redis itself?

key

Thanks, Shaurya

shauryaramakrishnan avatar Oct 08 '19 14:10 shauryaramakrishnan