Class: CookieStore

Isolated

Represents the cookie store.

Methods

addCookie

Adds a cookie to the cookie store according to the rules in RFC-6265.

addCookies

Adds an array of cookies.

getCookies

Gets the relevant cookies for the given URL and the path according to the rules in RFC-6265.

getAllCookies

Gets all the cookies in the cookie store.

getCookiesByName

Gets all the cookies, which have the given name as the name of the cookie.

getCookiesByDomain

Gets all the cookies, which have the given name as the domain of the cookie.

removeCookie

Removes a specific cookie.

removeCookiesByDomain

Removes cookies, which match with the given domain.

removeExpiredCookies

Removes all expired cookies.

removeAllCookies

Removes all the cookies.

addCookie

function addCookie(Cookie cookie, CookieConfig cookieConfig, string url, string requestPath) returns CookieHandlingError?
Isolated Function

Adds a cookie to the cookie store according to the rules in RFC-6265.

Parameters

  • cookie Cookie
  • Cookie to be added

  • cookieConfig CookieConfig
  • Configurations associated with the cookies

  • requestPath string
  • Resource path

Return Type

(CookieHandlingError?)

An http:CookieHandlingError if there is any error occurred when adding a cookie or else ()

addCookies

function addCookies(Cookie[ ] cookiesInResponse, CookieConfig cookieConfig, string url, string requestPath)
Isolated Function

Adds an array of cookies.

Parameters

  • cookiesInResponse Cookie[ ]
  • Cookies to be added

  • cookieConfig CookieConfig
  • Configurations associated with the cookies

  • requestPath string
  • Resource path

getCookies

function getCookies(string url, string requestPath) returns Cookie[ ]
Isolated Function

Gets the relevant cookies for the given URL and the path according to the rules in RFC-6265.

Parameters

  • url string
  • URL of the request URI

  • requestPath string
  • Path of the request URI

Return Type

(Cookie[ ])

Array of the matched cookies stored in the cookie store

getAllCookies

function getAllCookies() returns Cookie[ ]
Isolated Function

Gets all the cookies in the cookie store.

Return Type

(Cookie[ ])

Array of all the cookie objects

getCookiesByName

function getCookiesByName(string cookieName) returns Cookie[ ]
Isolated Function

Gets all the cookies, which have the given name as the name of the cookie.

Parameters

  • cookieName string
  • Name of the cookie

Return Type

(Cookie[ ])

Array of all the matched cookie objects

getCookiesByDomain

function getCookiesByDomain(string domain) returns Cookie[ ]
Isolated Function

Gets all the cookies, which have the given name as the domain of the cookie.

Parameters

  • domain string
  • Name of the domain

Return Type

(Cookie[ ])

Array of all the matched cookie objects

removeCookie

function removeCookie(string name, string domain, string path) returns CookieHandlingError?
Isolated Function

Removes a specific cookie.

Parameters

  • name string
  • Name of the cookie to be removed

  • domain string
  • Domain of the cookie to be removed

  • path string
  • Path of the cookie to be removed

Return Type

(CookieHandlingError?)

An http:CookieHandlingError if there is any error occurred during the removal of the cookie or else ()

removeCookiesByDomain

function removeCookiesByDomain(string domain) returns CookieHandlingError?
Isolated Function

Removes cookies, which match with the given domain.

Parameters

  • domain string
  • Domain of the cookie to be removed

Return Type

(CookieHandlingError?)

An http:CookieHandlingError if there is any error occurred during the removal of cookies by domain or else ()

removeExpiredCookies

function removeExpiredCookies() returns CookieHandlingError?
Isolated Function

Removes all expired cookies.

Return Type

(CookieHandlingError?)

An http:CookieHandlingError if there is any error occurred during the removal of expired cookies or else ()

removeAllCookies

function removeAllCookies() returns CookieHandlingError?
Isolated Function

Removes all the cookies.

Return Type

(CookieHandlingError?)

An http:CookieHandlingError if there is any error occurred during the removal of all the cookies or else ()