I'd like to create a cookie that expires within 5 minutes of the user visiting my page.
I know about add_cookie()
function, but have no idea how to set it to expire.
I'd like to create a cookie that expires within 5 minutes of the user visiting my page.
I know about add_cookie()
function, but have no idea how to set it to expire.
You can set cookies in the scripts/response_main.ts
file as such:
set_cookie("cookie_name", "cookie_val")
cookie("cookie_name") {
cookie.expires("Wed, 09 Jun 2021 10:18:14 GMT")
}
Check out this link for more info.