tink_http icon indicating copy to clipboard operation
tink_http copied to clipboard

Cookies

Open kevinresol opened this issue 9 years ago • 5 comments

kevinresol avatar May 12 '16 06:05 kevinresol

There is some duplication between this and some changes I made in the meantime. I will decide how to go about this after the WWX.

back2dos avatar May 24 '16 09:05 back2dos

Do we have any updates on this one?

kevinresol avatar Jun 17 '16 13:06 kevinresol

Yeah, sorry. So, uhm, as I said I implemented Set-Cookie too, which is here: https://github.com/haxetink/tink_http/blob/master/src/tink/http/Header.hx#L114 I can't say I'm overly happy with it (except the fact that httpOnly is the default). We definitely need to use some of your date formatting logic though (my version currently just throws an exception on JS because DateTools.format is not implemented) and solve the DST issue. The lack of plain UTC support in Haxe is quite frustrating, to be honest ... :S

Meanwhile, for parsing, one can simply use tink.url.Query.parseString(theCookie, ';'), which also handles trimming and urldecoding. Which reminds me though that tink_web should leverage that to just parse cookies.

back2dos avatar Jun 18 '16 08:06 back2dos

thx.core supports UTC dates. But I am not sure what to do with DST.

kevinresol avatar Jun 18 '16 08:06 kevinresol

Yeah. I've seen that, although it's kind of silly to add 15KLOC to get that. There's also DateTime, which is smaller, but still has around 4KLOC. I prefer to err on the side of leanness. Anyway, I'll solve this over the weekend, since I need it myself :D

back2dos avatar Jun 18 '16 09:06 back2dos