Skip to content
This repository has been archived by the owner on Sep 6, 2023. It is now read-only.

have a extra comma (,) in what I get using cookie:get("xxx") #6

Closed
hy05190134 opened this issue Jan 27, 2015 · 2 comments
Closed

have a extra comma (,) in what I get using cookie:get("xxx") #6

hy05190134 opened this issue Jan 27, 2015 · 2 comments

Comments

@hy05190134
Copy link

cookie = ck:new()
cookie:set({key = "aa", value = "vaa"})
cookie:set({key = "bb", value = "vbb"})

next time I using the cookie to using cookie:get("aa"), it return "vaa,", not just "vaa"

@calio
Copy link
Contributor

calio commented Jan 27, 2015

It looks like there is a bit confusion here. set is used to set cookie to client, so it only affects response header. get is used to get cookies that client sends to server. So if you use cookie:set and cookie:get in the same request, cookie:get will return the client cookie. Not the one you just set.

@hy05190134
Copy link
Author

finally, it is my default that in my case headers["Cookie"] = "xxx, xxx, xx" but not "xxx; xxx; xx", thank you for replying my questions.

@calio calio closed this as completed Aug 10, 2015
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

2 participants