Skip to content

[Feature Request]: Export & Import all cookies from session #193

@mchudie

Description

@mchudie

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions