Home Reference Source Test Repository
import CookieUtil from 'rizzo-next/src/core/cookie_util.js'
public class | source

CookieUtil

A utility for managing cookies

Test:

Constructor Summary

Public Constructor
public

constructor(objectPattern: {"cookies": *})

Member Summary

Public Members
public

cookies: *

Method Summary

Public Methods
public

getCookie(cookieName: String, format: String): String | Object

Retrievew a cookie by it's name

public

removeCookie(name: *)

public

setCookie(k: String, v: String, days: [Number], domain: [String], path: [String]): *

Set a cookie

Public Constructors

public constructor(objectPattern: {"cookies": *}) source

Params:

NameTypeAttributeDescription
objectPattern {"cookies": *}
  • optional
  • default: {}

Public Members

public cookies: * source

Public Methods

public getCookie(cookieName: String, format: String): String | Object source

Retrievew a cookie by it's name

Params:

NameTypeAttributeDescription
cookieName String

Name of the cookie to retrieve

format String

Whether or not the cookie should be parsed with JSON

Return:

String | Object

The cookie

public removeCookie(name: *) source

Params:

NameTypeAttributeDescription
name *

public setCookie(k: String, v: String, days: [Number], domain: [String], path: [String]): * source

Set a cookie

Params:

NameTypeAttributeDescription
k String

Cookie name

v String

Cookie value

days [Number]

Expiration in days

domain [String]

Domain of the cookie

path [String]

Path of the cookie

Return:

*