Proactively refreshes a cookie session using Roblox's session refresh endpoint.
This creates a new session and invalidates the old one, returning the new cookie.
Use this to manually trigger cookie rotation before the automatic rotation kicks in,
or to refresh cookies on a schedule to ensure they don't expire.
This function uses the library's internal fetch mechanism, which includes:
Automatic CSRF token handling
Hardware-backed authentication (HBA) signatures
Generic challenge handling (if configured)
cookieIndex - Index in the cookie pool to refresh (default: 0). Ignored if using single cookie.
Result object with success status and new cookie value if successful
// Refresh the default/first cookie constresult = awaitrefreshCookie(); if (result.success) { console.log('New cookie:', result.newCookie); // Persist the new cookie to your storage awaitdb.updateCookie(result.poolIndex, result.newCookie); }
// Refresh a specific cookie in the pool constresult = awaitrefreshCookie(2); // Refresh third account
// Refresh all cookies in a pool constcookies = getCookies(); for (leti = 0; i < cookies.length; i++) { constresult = awaitrefreshCookie(i); if (result.success) { awaitdb.updateCookie(i, result.newCookie); } }
Proactively refreshes a cookie session using Roblox's session refresh endpoint. This creates a new session and invalidates the old one, returning the new cookie.
Use this to manually trigger cookie rotation before the automatic rotation kicks in, or to refresh cookies on a schedule to ensure they don't expire.
This function uses the library's internal fetch mechanism, which includes:
cookieIndex - Index in the cookie pool to refresh (default: 0). Ignored if using single cookie. Result object with success status and new cookie value if successful