The Cookies class provides a simple and convenient way to manage cookies in a web application. It offers methods for retrieving, adding, and removing cookies with additional options for security.
It is defined as static, so there's no need to create an instance.
Returns the value of the cookie with the specified name.
Cookies.get('username');
name data type description type name
String The name of the cookie Required
data type value description null null The cookie does not exist String The value of the specified cookie The value of the specified cookie
Adds a new cookie with the given name and value.
Cookies.add('username', 'John Doe');
name data type description type name
String The name of the cookie Required value
String The value of the cookie Required
Removes the cookie with the specified name.
Cookies.remove('username');
name data type description type name
String The name of the cookie Required