-
-
Notifications
You must be signed in to change notification settings - Fork 83
Cookie Example? #149
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
Comments
An example of accomplishing what? |
(Facepalm. My bad) While I would be interested in seeing an example of a server that returns a token as a cookie, it's the client side that I wanted to code in Lua. Receiving, storing and returning the token is what I'm focused on at the moment. |
A request object has a |
local http_cookie = require "http.cookie"
local function my_onstream_handler(request_headers, stream)
-- .....
response_headers:append("set-cookie", http_cookie.bake("mycookiename", "mycookievalue"))
-- .....
end |
Okay, I have a little more of my use case now: The next request will be a GET request to update the status from the client (I didn't write this API): Also, I am unfortunately splitting my questions between github and lua-l. Please let me know where you'd prefer that I ask these questions? |
The default cookiejar will be reused automatically if you create a new request: it's opt-out; not opt-in.
I'm fine with either. |
Awesome, works as advertised. Your DEBUG_SOCKET suggestion in #151 was what I needed to see what's going on. |
Hi @daurnimator,
I'm just approaching using cookies and was wondering if an example could be provided?
The text was updated successfully, but these errors were encountered: