The Official Blog of Patcoola

Im just a dude watching over my parents,
and trying to make cartoons and video games from home.

Script: Cookies [JS API]

, By Patcoola

Script Title: cookies
Programming Language: Java Script
Date Completed: 2013/04/23

Purpose: Easily access and manage Cookies with Java Script.


Donate Now!

This might not be the best time, but making a blog is not easy. Would you consider donating?

Description: Access and manage Cookies with Java Script though an easy to use API.

Compatibility: Works with all modern Web browsers.


cookies.has ( name_s )

Function to scan the cookie jar for a cookie.
Returns true or false, returns undefined if the input is not a string.

cookies.get ( name_s )

Function to fetch and return the value of a cookie.
Returns the value of the cookie as a string, returns undefined if no cookie is found.

cookies.set ( name_s, value_s, expire_date, domain_s, path_s, secure_b )

Function to set the value or create a cookie.
Return true or false if successful.

cookies.remove ( name_s )

Function to remove a cookie from the jar.

cookies.jar ()

Function to list and view all cookies in the jar.
Returns an array.

cookies.count ()

Function to count the number of cookies in the jar.
Returns a number.

cookies.size ()

Function to calculate the bytes of data currently used in the jar.
Returns a number measured in bytes.

cookies.freeSpace ()

Function to calculate the bytes of data still available in the jar.
Returns a number measured in bytes.

cookies.totalSpace ()

Function to return the value 4096 as the total amount of bytes for the jar.
Returns the number 4096.

cookies.crumbsToArray ( cookie_s )

Function to convert a multiple value cookie into an array.
Returns an array up to two dimensions.

cookies.arrayToCrumbs ( array_a )

Function to convert an array of up to two dimensions into a multiple value cookie.
Returns a string, or undefined if the input is not an array.



Donate Now!

After a hard day, I like to relax with a cold jar of pickle juice and a hardy fart. If you like my blog, please consider donating.


Post Meta

Share Post


Comments: Write Comment

Be the first to write a comment.

Leave a Comment

All comments are reviewed before publishing. Comments must be related to the page topic, must not be spam, and must comply with the criminal code of Canada.