Garry's Mod Wiki

cookie.Delete

🍪 Cookie - Delete

  cookie.Delete( string key )

Description

Removes any cookie with the given name.

Does nothing if the cookie doesn't exist.

Arguments

1 string key
The name of the cookie that you want to delete.




Example

Sets & deletes a cookie & print it's values on every step.

cookie.Set('My-Cookie','Hello World') print('Set My-Cookie') print('My-Cookie:',cookie.GetString('My-Cookie')) cookie.Delete('My-Cookie') print('Deleted My-Cookie') print('My-Cookie:',cookie.GetString('My-Cookie'))
Output:
Set My-Cookie My-Cookie: Hello World Deleted My-Cookie My-Cookie: nil