Reference documentation and code samples for the Google Cloud Chronicle Client class Cookie.
Browser cookie.
Generated from protobuf message google.backstory.Browser.Cookie
Namespace
Google \ Backstory \ BrowserMethods
__construct
Constructor.
| Parameters | |
|---|---|
| Name | Description |
data |
array
Optional. Data for populating the Message object. |
↳ name |
string
The unique name identifying the cookie. |
↳ value |
string
The data stored within the cookie. |
↳ domain |
string
The domain for which the cookie is valid. |
↳ path |
string
The URL path for which the cookie is valid. |
↳ expiration_time |
Google\Protobuf\Timestamp
The date and time when the cookie will expire. |
↳ http_only |
bool
Indicates if the cookie is inaccessible via client-side scripts (e.g., JavaScript). |
↳ secure |
bool
Indicates if the cookie should only be sent over secure HTTPS connections. |
↳ max_age |
int|string
The maximum age of the cookie in seconds. |
↳ same_site |
int
Affects cross-site request behavior. |
↳ session |
bool
Indicates if the cookie is persistent. |
↳ partitioned |
bool
Shows if the cookies is stored using partitioned storage. |
getName
The unique name identifying the cookie.
| Returns | |
|---|---|
| Type | Description |
string |
|
setName
The unique name identifying the cookie.
| Parameter | |
|---|---|
| Name | Description |
var |
string
|
| Returns | |
|---|---|
| Type | Description |
$this |
|
getValue
The data stored within the cookie.
| Returns | |
|---|---|
| Type | Description |
string |
|
setValue
The data stored within the cookie.
| Parameter | |
|---|---|
| Name | Description |
var |
string
|
| Returns | |
|---|---|
| Type | Description |
$this |
|
getDomain
The domain for which the cookie is valid.
| Returns | |
|---|---|
| Type | Description |
string |
|
setDomain
The domain for which the cookie is valid.
| Parameter | |
|---|---|
| Name | Description |
var |
string
|
| Returns | |
|---|---|
| Type | Description |
$this |
|
getPath
The URL path for which the cookie is valid.
| Returns | |
|---|---|
| Type | Description |
string |
|
setPath
The URL path for which the cookie is valid.
| Parameter | |
|---|---|
| Name | Description |
var |
string
|
| Returns | |
|---|---|
| Type | Description |
$this |
|
getExpirationTime
The date and time when the cookie will expire.
| Returns | |
|---|---|
| Type | Description |
Google\Protobuf\Timestamp|null |
|
hasExpirationTime
clearExpirationTime
setExpirationTime
The date and time when the cookie will expire.
| Parameter | |
|---|---|
| Name | Description |
var |
Google\Protobuf\Timestamp
|
| Returns | |
|---|---|
| Type | Description |
$this |
|
getHttpOnly
Indicates if the cookie is inaccessible via client-side scripts (e.g., JavaScript).
| Returns | |
|---|---|
| Type | Description |
bool |
|
setHttpOnly
Indicates if the cookie is inaccessible via client-side scripts (e.g., JavaScript).
| Parameter | |
|---|---|
| Name | Description |
var |
bool
|
| Returns | |
|---|---|
| Type | Description |
$this |
|
getSecure
Indicates if the cookie should only be sent over secure HTTPS connections.
| Returns | |
|---|---|
| Type | Description |
bool |
|
setSecure
Indicates if the cookie should only be sent over secure HTTPS connections.
| Parameter | |
|---|---|
| Name | Description |
var |
bool
|
| Returns | |
|---|---|
| Type | Description |
$this |
|
getMaxAge
The maximum age of the cookie in seconds.
| Returns | |
|---|---|
| Type | Description |
int|string |
|
setMaxAge
The maximum age of the cookie in seconds.
| Parameter | |
|---|---|
| Name | Description |
var |
int|string
|
| Returns | |
|---|---|
| Type | Description |
$this |
|
getSameSite
Affects cross-site request behavior.
| Returns | |
|---|---|
| Type | Description |
int |
Enum of type CookieSameSite. |
setSameSite
Affects cross-site request behavior.
| Parameter | |
|---|---|
| Name | Description |
var |
int
Enum of type CookieSameSite. |
| Returns | |
|---|---|
| Type | Description |
$this |
|
getSession
Indicates if the cookie is persistent.
| Returns | |
|---|---|
| Type | Description |
bool |
|
setSession
Indicates if the cookie is persistent.
| Parameter | |
|---|---|
| Name | Description |
var |
bool
|
| Returns | |
|---|---|
| Type | Description |
$this |
|
getPartitioned
Shows if the cookies is stored using partitioned storage.
| Returns | |
|---|---|
| Type | Description |
bool |
|
setPartitioned
Shows if the cookies is stored using partitioned storage.
| Parameter | |
|---|---|
| Name | Description |
var |
bool
|
| Returns | |
|---|---|
| Type | Description |
$this |
|