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

How to set expiry time while setting the cookie #20

Open
shrivallabhDeshmukh opened this issue Apr 23, 2019 · 2 comments
Open

How to set expiry time while setting the cookie #20

shrivallabhDeshmukh opened this issue Apr 23, 2019 · 2 comments

Comments

@shrivallabhDeshmukh
Copy link

I need to set cookie expiration time . Please help

@shrivallabhDeshmukh shrivallabhDeshmukh changed the title How to set expire time while setting the cookie How to set expiry time while setting the cookie Apr 23, 2019
@boralp
Copy link

boralp commented Apr 30, 2019

Sadly there is no implementation of expiration date on this project.

@foumart
Copy link

foumart commented Feb 22, 2021

It took me some time to figure it out (less than two years though :). Here is how to set expiry time:

let cookieName = 'my_cookie_name';
let cookieValue = 1;
let expirySeconds = 86400; // 1 day = 60*60*24

cookieMaster.setCookieValue(URL, cookieName, `${cookieValue}; max-age=${expirySeconds};`);

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

3 participants