Dealing with cookies on replit

Hey there.

I am currently trying to move my verification bot to host it on replit, but as expected, I’m having issues with the cookie not working from the new IP which my replit server is at. Further I can not login via the auth api, as that requires a captcha.
Has anyone come across any working solutions for this problem?

1 Like

Which method are you using to contact Replit?

What exactly do you mean? I am simply running the code on replit, in the replit environment
(here, a screenshot incase that helps answer your question)

are you using replit for a roblox game?

No, I am using it for a discord bot that needs access to per-account roblox api

I’m having the same issue. I get the 401 Error code which means unauthorized.

Found a solution for this (for post requests you will need to be getting your csrf token manually probably though).

There are quite a few repls that allow you to run chrome/firefox in replit, you can log into your roblox account there and extract the cookie. That one works.

1 Like

I put x-csrf-token in the request headers?

Sorry for the slow response.

If you are using something like replit, launch a command line version of a browser or so (so that you’re on the same ip), log in, get your cookie, then before every actual request, send a request to https://auth.roblox.com/v2/logout (this will not actually log you out because it is unauthorised) with x-csrf-token header set to undefined/nil/null/empty string. This will then return a valid x-csrf-token in the response headers which you can use for your actual request.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.