-
-
Notifications
You must be signed in to change notification settings - Fork 242
Description
Describe the feature / enhancement and how it would improve things
Currently getCookiesFromSession(url) only returns cookies that would be sent for a given URL.
This means there is no way to retrieve the entire cookie jar of a session.
Many real-world use cases require exporting and re-importing all cookies:
- Backing up and restoring login sessions
- Migrating cookies between different sessions or environments
- Debugging HTTP flows
- Persisting authentication state across runs
Adding an API to export and import the full set of cookies would make the library more flexible and closer to browser-like behavior.
Describe how your proposal will work, with code and/or pseudo-code
// Example new API functions:
// Export all cookies from a session
// Input: {"sessionId":""}
// Output: {"id":"", "cookies":[ ... ]}
extern char* getAllCookiesFromSession(const char* params);
// Import cookies into a session
// Input: {"sessionId":"", "cookies":[ ... ]}
// Output: success/error
extern char* setCookiesToSession(const char* params);
// The cookie format can reuse the same structure as transformCookies()
// that is already returned by getCookiesFromSession(url).