A Secure Online Service from Utah.gov

Utah.gov

STAT 2.0

A Service from Utah.gov

STAT.cookies

STAT Create a cookie

Syntaxes

  • stat.cookies.setItem(name, value[, end[, path[, domain[, secure]]]])
  • stat.cookies.getItem(name)
  • stat.cookies.removeItem(name[, path[, domain]])
  • stat.cookies.hasItem(name)
  • stat.cookies.keys()

Examples

Create cookie:

stat.cookies.setItem("myCookie", "myValue");

Read cookie:

stat.cookies.getItem("myCookie");

Check for cookie:

stat.cookies.hasItem("myCookie");