andreizanik / cookies-next

Getting, setting and removing cookies on both client and server with next.js

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Expires prop has incorrect types

KubaZachacz opened this issue · comments

docs says:

expires
Date object or number days count

but it seems like number is not a correct type

TypeError: option expires is invalid

it looks like it goes down to 'cookie' library which has type:

    expires?: Date | undefined;

Thanks, you are right!
I corrected the documentation in release v2.0.5

You need to use maxAge if you want to specify a number (in second)