getCookieDomain

The getCookieDomain() method returns a domain where visitor cookies (_pk_id.*) and session cookies ( _pk_ses.*) are stored. The domain is set using the setCookieDomain() method.

Syntax

getCookieDomain()
getCookieDomain(): Promise<string>
getCookieDomain(): Promise<string>
getCookieDomain(): Promise<string>
getCookieDomain(): Promise<string>
getCookieDomain(): Promise<string>
getCookieDomain(): Promise<string>

Returns

The domain where visitor cookies (_pk_id.*) and session cookies ( _pk_ses.*) are stored.

Format: Example: .example.com.

Type: string

Examples

To get a domain where visitor and session cookies are stored:

_paq.push([function () {  
    console.log(this.getCookieDomain());  
}]);
getCookieDomain(): Promise<string>
getCookieDomain(): Promise<string>
getCookieDomain(): Promise<string>
getCookieDomain(): Promise<string>
getCookieDomain(): Promise<string>
getCookieDomain(): Promise<string>

A sample of the return value:

.example.com

Related methods