Skip to content

Conversation

kevinresol
Copy link
Member

No description provided.

}

function formatDate(date:Date) {
var timezoneOffset =
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A good idea, but unfortunately won't work during DST :(

Copy link
Member Author

@kevinresol kevinresol May 24, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't live in a place with DST so I don't know much about it.
Does the computer even know DST is in effect currently?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, lucky you :)

Yeah, I think it's handled all the way down to the OS (or so it seems). And it's a PITA to deal with. I suppose if we could do all of this in UTC itself, it would be a lot easier.

@back2dos
Copy link
Member

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.

@kevinresol
Copy link
Member Author

Do we have any updates on this one?

@back2dos
Copy link
Member

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.

@kevinresol
Copy link
Member Author

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

@back2dos
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants