Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Isomorphic cookie API #40

Open
charypar opened this issue Apr 15, 2015 · 8 comments
Open

Isomorphic cookie API #40

charypar opened this issue Apr 15, 2015 · 8 comments

Comments

@charypar
Copy link
Member

Similar to the redirect API, we should support a cookie handling API for reading and setting cookies uniformly on both sides of the wire.

/cc @gregstewart

@gregstewart
Copy link
Contributor

Thanks for logging this. Additional things to consider with reading/setting cookies (just in case you hadn't), some cookies maybe only be http ones and secure (i.e. served over https). Not sure if and how this impacts the approach to solving this.

@tabazevedo
Copy link

As a side note, being able to inject stuff into app-state before rendering server-side would be quite useful for stuff like loading stuff based on cookie data. Alternatively, giving Arch access to cookie data can also work.

@charypar
Copy link
Member Author

@tabazevedo should be doable in applications start call? Or am I missing something?

@tabazevedo
Copy link

@charypar we need the request object from the http server to access cookies (which isnt available in start initialiser as it stands). we're currently doing it via our custom server, but obviously we want to be as seamless as possible.

@charypar
Copy link
Member Author

@tabazevedo I think you'd get arch.cookies function to read cookies, that would do different things based on where you are calling it...

@tabazevedo
Copy link

See #53

@chrisvfritz
Copy link
Contributor

Since this is still open, I figured I'd mention set-cookie, which does this already and is used at AirBnB (not affiliated).

@tabazevedo
Copy link

@chrisvfritz oh, thanks for that. Super useful. Ended up writing my own in a spike i did a little while ago but its probably better to use that, looks great

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

No branches or pull requests

4 participants