alexedwards / scs

HTTP Session Management for Go
MIT License
2.13k stars 166 forks source link

[help] Strange behavior #48

Closed gstvg closed 6 years ago

gstvg commented 6 years ago

Sorry, i cant share the code right now. Just need some light for finding the issue. Sometimes the session just doesnt work and create many tokens for the same user (im using mysqlstore, so is easy to see this). Now session only works after calling RenewToken. Did this descriptions identify with any common misuse of the library? Ive already tried a lot of things. Thanks and sorry for the lack of more info.

alexedwards commented 6 years ago

It could be something to do with your cookies not being sent back by your browser... Are the cookie path, domain, httponly and secure settings correct?

gstvg commented 6 years ago

Hi, thanks. Accessing from localhost with no custom setting should work right? Ive used even Wireshark to confirm, browser send the cookie and receives a new Set-Cookie header, without calling RenewToken. Thanks again!

alexedwards commented 6 years ago

Yes, it should work from localhost with not custom settings. Are you using a framework or just plain net/http?

gstvg commented 6 years ago

Thank you. Misconfigured database time make every token expired as soon as created. Sorry, my bad. And thanks for the awesome library.