Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Difference between .clearAll .flush .removeSessionCookies #170

Open
Norfeldt opened this issue Feb 17, 2023 · 0 comments
Open

Difference between .clearAll .flush .removeSessionCookies #170

Norfeldt opened this issue Feb 17, 2023 · 0 comments

Comments

@Norfeldt
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant