Skip to content

Difference between .clearAll .flush .removeSessionCookiesΒ #170

@Norfeldt

Description

@Norfeldt

Chat GPT explains it like this

clearAll(): This method removes all cookies from the cookie store. Any cookies set by your application or by other websites will be removed. This method takes no arguments and returns a promise that resolves when the cookies have been cleared.

flush(): This method saves all cookies to the cookie store immediately. Normally, cookies are saved periodically in the background, but this method forces an immediate save. This method takes no arguments and returns a promise that resolves when the cookies have been saved.

removeSessionCookies(domain: string): This method removes all session cookies for a specific domain. Session cookies are cookies that have no expiration time and are deleted when the user closes the application or the browser. This method takes a single argument, the domain of the cookies to remove, and returns a promise that resolves when the cookies have been removed.

In summary, clearAll removes all cookies, flush saves all cookies immediately, and removeSessionCookies removes only session cookies for a specific domain. It's important to note that these methods operate on the global cookie store, so if you have multiple applications running in the same environment, these methods will affect all of them.

Is this correct?

(I read it like when calling .clearAll() I do not need to call .removeSessionCookies as well?)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions