Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

cookie options

const cookiesOptions = {
    httpOnly: true,
    expires: new Date(
      //   Cookie Expire is in days so we convert it in milliseconds to add it to date
      Date.now() + process.env.COOKIE_EXPIRE * 24 * 60 * 60 * 1000
    ),
  };
 
PREVIOUS NEXT
Tagged: #cookie #options
ADD COMMENT
Topic
Name
6+2 =