bernabe9 / redux-react-session

:key: Simple Session API storage for Redux and React
https://bernabe9.github.io/redux-react-session/
147 stars 41 forks source link

Allow an option not to set expiry for cookies #44

Closed velhari closed 5 years ago

velhari commented 5 years ago

Hi,

Can you provide this feature for COOKIES option.

Generally for Cookies, if we didn't set an "expires" param then it lasts only for the session. It will expired automatically when browser closes.

This feature is very helpful for the logged-in user who forget to logs out the website. Information stored in cookies will get removed whenever the browser gets closed otherwise it will stay there for the time we set for expire parameter

Thanks Velu

velhari commented 5 years ago

Hi,

Can you provide this feature for COOKIES option.

Generally for Cookies, if we didn't set an "expires" param then it lasts only for the session. It will expired automatically when browser closes.

This feature is very helpful for the logged-in user who forget to logs out the website. Information stored in cookies will get removed whenever the browser gets closed otherwise it will stay there for the time we set for expire parameter

Thanks Velu

I have modified below in my local which is working fine. Can you please review and update the package

if ( instance.expires === "session" ){ Cookies.set(_constants.USER_SESSION, session); }else{ Cookies.set(_constants.USER_SESSION, session, { expires: instance.expires }); }

Thanks, Velu

velhari commented 5 years ago

After went through "js-cookie" package, if we give empty string for expires parameter then it will treat this as session and it clears out when browser closes

Thanks Velu