javascripthtmlangularcookiesangular-cookies

Set 'session' as cookie expiry instead of number [ng2-cookies]


I am using ng2-cookies, and it is clear from here that expiry is expected to be a number.

I want to set expiry as browser-session session like it appears in dev-tools.

Any help?


Solution

  • Just tried sending undefined as value to optional param expiry and it worked.

    Cookie.set('token', user.token, undefined, '/');