Skip to content
This repository has been archived by the owner on Jan 5, 2024. It is now read-only.

Error upon Max-Age in set-cookie header #15

Open
thomthom opened this issue Oct 11, 2014 · 0 comments
Open

Error upon Max-Age in set-cookie header #15

thomthom opened this issue Oct 11, 2014 · 0 comments

Comments

@thomthom
Copy link

I ran into a problem where I would not get any cookies set given this header:
"s=AAAAAAAAY1UAAAFJAB4UawAAAAAAAAAApPcqHqisJSmL4TuQ-RsJradrFZt9fTMSdEi8bw; Domain=.example.com; Path=/; HttpOnly; Secure; Max-Age=63072000"

Using set_cookies_from_headers would not do anything, but also not yield any errors. Eventually after poking around in the source code I called the methods that set_cookies_from_headers calls and found there to be errors:

CookieJar::Cookie.from_set_cookie("https://example.com/", "s=AAAAAAAAY1UAAAFJAB4UawAAAAAAAAAApPcqHqisJSmL4TuQ-RsJradrFZt9fTMSdEi8bw; Domain=.example.com; Path=/; HttpOnly; Secure; Max-Age=63072000").inspect
Error: #<CookieJar::InvalidCookieError: Unknown cookie parameter 'max-age'>
C:/Users/Thomas/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Gems64/gems/cookiejar-0.3.2/lib/cookiejar/cookie_validation.rb:324:in `block in parse_set_cookie'
C:/Users/Thomas/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Gems64/gems/cookiejar-0.3.2/lib/cookiejar/cookie_validation.rb:297:in `each'
C:/Users/Thomas/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Gems64/gems/cookiejar-0.3.2/lib/cookiejar/cookie_validation.rb:297:in `parse_set_cookie'
C:/Users/Thomas/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Gems64/gems/cookiejar-0.3.2/lib/cookiejar/cookie.rb:92:in `from_set_cookie'
<main>:in `<main>'
SketchUp:1:in `eval'

Should it really raise errors upon unknown value? Or rather ignore those and yet save the cookie using the value it does now. I'd prefer that former.

Any workaround for this?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant