Closed typpo closed 11 years ago
I found this problem when making changes to allow custom expirations. This would help avoid having the cookie inflate request size with a year's worth of A/B tests. Unfortunately, this bug is a blocker for a custom expiration option.
Any chance you could edit the coffeescript?
On Wed, Mar 20, 2013 at 3:26 PM, Ian Webster notifications@github.comwrote:
I found this problem when making changes to allow custom expirations. This would help avoid having the cookie inflate request size with a year's worth of A/B tests. Unfortunately, this bug is a blocker for a custom expiration option.
— Reply to this email directly or view it on GitHubhttps://github.com/maccman/abba/pull/8#issuecomment-15207757 .
Alex MacCaw
+12147175129 @maccman
My attached change (e73c4d7) edits the coffeescript and solves the problem.
My bad, I missed that, so I applied the fix straight to master. Thanks so much! Really appreciated.
'extend', when compiled to js, was returning an array of arrays rather than an object due to implicit return.
This broke the options sent to setCookie, because the 'expires' attribute of the returned options object was always undefined, so the cookie expiration field was never set as options.expires.toGMTString().
As a result, the abbaVariant and abbaPersistComplete cookies incorrectly had no expiration date or a received a default expiration from the browser, rather than the 600 day expiration specified in the code.
Below is the old
extend
, compiled to js, which incorrectly returns a list:An explicit return compiles correctly: