Skip to content

A set of generic methods for getting and setting cookies.

Notifications You must be signed in to change notification settings

mjcampagna/cookie-methods

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Cookie Methods

A set of generic methods for getting and setting cookies.

Methods

setCookie( name, value, daysUntilExpiry )

Creates a new cookie.

setCookie('allowCookies', 'yes', 365);

getCookie( name )

Returns the requested cookie if exists, or empty.

getCookie( 'allowCookies' );

deleteCookie( name )

Deletes the requested cookie; returns the deleted cookie if successful, or returns false.

deleteCookie( 'allowCookies' );

checkCookie( name )

Checks whether a given cookie exists; returns the cookie if found, else returns false.

checkCookie( 'allowCookies' );

Example

Open the index.html file for a sample implementation.

About

A set of generic methods for getting and setting cookies.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published