StorageState
Playwright\Browser\StorageState
Storage state container for cookies and localStorage data.
Methods
__construct()
function __construct( public array $cookies = [], public array $origins = [], )
fromJson()
selfCreate a StorageState from a JSON string.
function fromJson(string $json): self
fromFile()
selfLoad StorageState from a JSON file.
function fromFile(string $filePath): self
fromArray()
selffunction fromArray(array $data): self
toJson()
stringfunction toJson(int $flags = 0): string
toArray()
arrayfunction toArray(): array
saveToFile()
voidfunction saveToFile(string $filePath): void
isEmpty()
boolfunction isEmpty(): bool
getCookieCount()
intfunction getCookieCount(): int
getOriginCount()
intfunction getOriginCount(): int
getCookiesForDomain()
arrayfunction getCookiesForDomain(string $domain): array
getLocalStorageForOrigin()
arrayfunction getLocalStorageForOrigin(string $origin): array