hyTags
HomeHome DocumentationDocumentation

cookie-set

Sets a cookie with the specified name and value
Parameter
Type
Description
name
String
The name of the cookie
value
String?
The value of the cookie
expires
DateTime?
The expiration date of the cookie
max-age
Number?
The maximum age of the cookie in seconds
path
String?
The path for which the cookie is valid
secure
Bool?
Whether the cookie should only be sent over HTTPS
same-site
Bool?
Whether the cookie should be restricted to same-site requests
return
void
No return value
Test Case:Set cookie value
    <div></div>
    
    <cookie-set name="session" value="abc123">
    <cookie-get-value name="session">
    <assert-equal value="abc123" type="string">
    
    👆 Try to change something!
  • Test succeeded Test failed