pixelmund / svelte-kit-cookie-session

⚒️ Encrypted "stateless" cookie sessions for SvelteKit
MIT License
182 stars 11 forks source link

Need to expire cookies in minutes instead of days. #56

Closed midnightcodr closed 1 year ago

midnightcodr commented 1 year ago

I checked the source codes a bit but can't find a way set expiration period in minutes. The only supported option is to set expiry in # of days. If setting cookies in length shorter than a day is not supported, is there a plan to do so?

pixelmund commented 1 year ago

You could probably do something like 0.00x to specify the expiry in minutes but i have to check if that works currently

midnightcodr commented 1 year ago

I tried, but unfortunately it didn’t work.

zoltan-lima commented 1 year ago

How do you set the expiry date? I have been trying to use .set() but when I retrieve the session, the "expires" property is undefined whereas the rest of my properties are maintained.

pixelmund commented 1 year ago

It is now possible in v4.0.0 to set the type of expiry with the expires_in option, which should be of type days | hours | minutes | seconds