Class: ipcinfoCookie

ipcinfoCookie()

Utility to set and get the ipcInfo cookie needed to determine country and language code

Constructor

new ipcinfoCookie()

Source:

Methods

(static) get()

retreive the ipcInfo cookie that contains the cc and lc decodes and converts to object

Source:
Example
import { ipcinfoCookie } from '@carbon/ibmdotcom-utilities';

const info = ipcinfoCookie.get();

(static) set(params)

set the ipcInfo cookie with expiration of a year takes care of converting to string and encoding

Parameters:
Name Type Description
params object

params object

Properties
Name Type Description
cc string

country code

lc string

language code

Source:
Example
import { ipcinfoCookie } from '@carbon/ibmdotcom-utilities';

const locale = {cc: 'us', lc: 'en'}
ipcinfoCookie.set(locale);