HttpService Cookies

Does Roblox’s HttpService automatically support cookies? And if not, how would I go about implementing them myself?

My understanding of cookies is that when a browser makes a request to a server, that server can set some cookies in the Cookie header of the HTTP response. And then the client browser will send those cookies back in every subsequent request.

However, Roblox is not a browser, so I’m not sure if they’ll automatically handle cookies. Additionally, I see that on the wiki that you can add headers to the request (to send the cookies to the server):

image

But how would I get the headers from the response (to receive the cookies from the server)? Thanks!

1 Like

HttpService doesn’t support reading headers from responses, so you cannot implement it at all. You can set them though (by setting the Cookie header).

HttpService doesn’t keep track of cookies automatically to my knowledge, aside from caching it’s pretty much stateless.

2 Likes

Your best bet would be to host a proxy that keeps track of cookies from the response, and send them again (if thats what you need)

Man! I was hoping that there would be at least some workaround within Roblox’s APIs. Perhaps I should turn this into a feature request now.

1 Like

I was hoping that it wouldn’t come down to that. But that appears to be the best option. Thank you for the suggestion.

This is a very easy to use proxy that implements reading headers, among a lot of other things:

It works just like HttpService but with those extra features.

1 Like