[squeak-dev] Unknown cookie field: SameSite

John-Reed Maffeo jrmaffeo at gmail.com
Tue Dec 31 16:21:40 UTC 2019


This message is showing up in Transcript. It originates in #WebCookie
readFrom: .
I tried to add sameSite to the method, but my naive attempt did not work. I
also added getter and setter for the new cookie.

It originates from a device called HDHomeRun CONNECT on my local network
which I access via HTTP.

There is some information available
<https://web.dev/samesite-cookies-explained/> that describes it.

The incoming text appears to be
'__cfduid=de417e50c7d97807e66b4a536a928eade1577808700; expires=Thu,
30-Jan-20 16:11:40 GMT; path=/; domain=.hdhomerun.com; HttpOnly;
SameSite=Lax'

'From Squeak5.2 of 13 December 2018 [latest update: #18229] on 31 December
2019 at 9:18:36 am'!

!WebCookie methodsFor: 'initialize' stamp: 'jrm 12/31/2019 09:18'!
readFrom: aStream
"Read a cookie from the given stream"

| keyval key val |
aStream skipSeparators.
self halt.
name := (aStream upTo: $=) withBlanksTrimmed.
value := (aStream upTo: $;) withBlanksTrimmed.
[aStream atEnd] whileFalse:[
keyval := aStream upTo: $;.
key := (keyval copyUpTo: $=) withBlanksTrimmed.
val := (keyval copyAfter: $=) withBlanksTrimmed.
key asLowercase caseOf: {
['expires'] -> [self expiry: (self readExpiryFrom: val)].
['path'] -> [self path: (WebUtils unquote: val)].
['domain'] -> [self domain: (WebUtils unquote: val)].
['secure'] -> [self secure: true].
['version'] -> [self version: val].
['httponly'] -> [self httpOnly: true].
['comment'] ->[self comment: val].
['max-age'] ->[self expirySeconds: val asNumber].
['SameSite'] ->  [self sameSite: val].
} otherwise:[Transcript show: 'Unknown cookie field: ', key].
].! !


any suggestions?

-- 
John-Reed Maffeo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20191231/b9d53cf4/attachment.html>


More information about the Squeak-dev mailing list