A set of utils to get, set and remove cookie data.
- Source
 
Methods
(inner) get(name) → {null|string}
Gets a specific cookie.
Parameters:
| Name | Type | Description | 
|---|---|---|
name | string | The cookie to get.  | 
- Since
 - 1.0.0
 
- Source
 
Returns:
Returns a cookie or null if none found for name.
- Type:
 - null |
string  
Example
import { cookieStorage } from "@gravityforms/utils";
function Example() {
    console.log( cookieStorage.get( 'my-cookie' ) );
};(inner) remove(name) → {void}
Removes a cookie.
Parameters:
| Name | Type | Description | 
|---|---|---|
name | string | The cookie name.  | 
- Since
 - 1.0.0
 
- Source
 
Returns:
- Type:
 - void
 
Example
import { cookieStorage } from "@gravityforms/utils";
function Example() {
		cookieStorage.remove( 'my-cookie' );
};(inner) set(name, value, daysToExpire, updateExistingValue) → {null|string}
Creates and sets a cookie.
Parameters:
| Name | Type | Description | 
|---|---|---|
name | string | The cookie name.  | 
value | string | The cookie value.  | 
daysToExpire | null | | The number of days until cookie should expire. If not set, will expire at the end of the user sessions.  | 
updateExistingValue | boolean | Whether or not to update the existing cookie value to include the new value. Can be helpful for keeping cookie count lower for the browser.  | 
- Since
 - 1.0.0
 
- Source
 
Returns:
Returns a cookie or null if none found for name.
- Type:
 - null |
string  
Example
import { cookieStorage } from "@gravityforms/utils";
function Example() {
     const cookieValue = uniqueId( 'gform-alert' );
		cookieStorage.set( this.options.cookieName, cookieValue, 1, true );
};