Would you consider adding the ability to configure Session API to expire its cookie when the browser closes? I think this is possible by setting the $expire parameter of setcookie() to 0. Session API adds time() to beginning of the configuration variable, so we'd either need another configuration option, or perhaps if if the "cookie expire time" variable was set to -1, we could configure the cookie with an expire value of 0. Thoughts? Are there downsides to this?
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | session-expiration-1402926-5.patch | 2.6 KB | joelstein |
| #2 | session-expiration-1402926-2.patch | 2.51 KB | joelstein |
Comments
Comment #1
jhedstromI'd certainly consider a patch that provided this option. Aside from storing, and then removing a lot of data (eg, if a user flags a bunch of content, then closes their browser), I don't see a downside to making this configurable.
Comment #2
joelstein commentedOkay, here you go. This seems to work great in my testing.
Comment #3
joelstein commentedWhat do you think of the patch?
Comment #4
jhedstromThe code itself looks good. I'll try to test this out soon.
Comment #5
joelstein commentedNow that #1058960: Use an expiration logic when clearing sessions on cron is committed, this patch needs an update. Here's the latest version.
Comment #6
jhedstromI haven't forgotten about this, I'd just like some other users to test it out before committing.
Comment #7
Scott Ellis commentedThis patch was built for MichiganLegalHelp.org and it has worked flawlessly for the last six months. I have applied the patch to the most recent development version of Session API with no problem.
Comment #8
jhedstromCommitted #5 in 6db6bad. Thanks!
Comment #9
Scott Ellis commentedGreat! Thanks Joel and Jonathon. I have updated to the dev branch and everything works great.