ernest icon indicating copy to clipboard operation
ernest copied to clipboard

expire cookie when bugzilla token is missing/expired

Open willkg opened this issue 11 years ago • 3 comments

When you log into Ernest, it turns around and logs you into Bugzilla. It keeps the Bugzilla token in cache and gives you an Ernest session cookie.

It's possible for the Bugzilla token to expire or go away. In this instance, your Ernest session cookie should also expire/go away.

This is most easily reproducible when using simple cache. If you run ernest, log into bugzilla, kill ernest, then re-run ernest, then ernest has forgotten your bugzilla token, but you still have a login cookie.

This should get fixed.

willkg avatar Jan 06 '14 20:01 willkg

There's another issue here where I think we're not caching the Bugzilla tokens correctly and they're expiring from cache.

willkg avatar Jan 07 '14 21:01 willkg

I looked into it a bit and decided the easiest way to deal with all this is to rewrite all the cache/cookie/authentication code with Flask sessions. Docs on Flask sessions are here:

http://flask.pocoo.org/docs/quickstart/#sessions

That'll clean up a bunch of goofy stuff, so this is a good move.

willkg avatar Jan 07 '14 21:01 willkg

Sessions are stored client-side and there's no more caching, so that fixes some of the ways this bug manifests itself. The one thing it doesn't fix is if the token expires in Bugzilla. I'm not sure how to reproduce that, so it's hard to test.

Ergo, I'm going to leave this open.

willkg avatar Jan 08 '14 16:01 willkg