cookie

A cookie is a small value the browser sends along with a request. Sites use cookies for preferences, analytics and session identifiers. cookie inspects the cookie names visible to the current PHP request; it cannot list every cookie stored in your browser, including cookies for other paths, domains or sites.

DiagnosticsVersion 1.1.2StableAliases: coo
lil-terminal

Overview

Use cookie for Browser cookies. Common operations stay short; specialized forms add detail only when needed, so repeated work remains easy to understand, repeat and place in lil-terminal scripts.

How to use this safely

Use cookie to list names without revealing values. cookie -a shows the values of cookies whose names are not recognized as sensitive; cookie theme -a checks a single preference. The command also works as coo. To inspect data stored on the server, use ses instead. An export writes selected non-sensitive cookies as JSON. Import accepts a JSON object of cookie names and scalar values, with -r allowing conflicting names to be overwritten. New cookies are sent as HTTP headers: test the result in the next browser request, not only in the current terminal output. The PHP session cookie is not exposed or deleted by this module. Sensitive-looking names are masked and cannot be imported, but this name-based filter is not a guarantee that every private value will be recognized. Exported cookies can still identify a user or reveal preferences: do not publish the JSON file.

Syntax

lil-terminal
cookie [name|export|import] [options]

Reference

cookie

list visible cookie names

cookie -a

show non-sensitive values

cookie <name> [-a]

inspect one cookie

cookie <name> -d

delete one cookie

cookie -c

clear visible cookies without closing the session

cookie export [-o <file>]

export non-sensitive cookies to JSON

cookie import <file> [-r]

import safe cookies; -r overwrites conflicts

coo

short alias for cookie

Practical use and safety

Use cookie to list names without revealing values. cookie -a shows the values of cookies whose names are not recognized as sensitive; cookie theme -a checks a single preference. The command also works as coo. To inspect data stored on the server, use ses instead.

An export writes selected non-sensitive cookies as JSON. Import accepts a JSON object of cookie names and scalar values, with -r allowing conflicting names to be overwritten. New cookies are sent as HTTP headers: test the result in the next browser request, not only in the current terminal output.

The PHP session cookie is not exposed or deleted by this module. Sensitive-looking names are masked and cannot be imported, but this name-based filter is not a guarantee that every private value will be recognized. Exported cookies can still identify a user or reveal preferences: do not publish the JSON file.

In Minimum, cookie, cookie -a and reading one name work. Deletion, clearing, export and import require Base.

Interactive sandbox preview

Run the prepared examples directly on the page. Their results are prebuilt and shown in the browser; no terminal command is executed on the server.

List visible cookie names

Install and manage

Install the current compatible version. Choose Base for the complete feature set or Minimum for the reduced package; use upgrade to update a module that is already installed.

Base and Minimum are two packages of the same current module release, not separate command versions.

Base package

Install the complete package with local command reference and every published mode.

install cookie
Minimum package

Install the reduced package. Local reference is omitted; help <cmd> -i opens the current server reference.

install cookie -m
Exact public version

Install exactly this published version.

install cookie -v 1.1.2
Check or update

Ask upgrade to check compatibility and replace the installed block only when needed.

upgrade cookie
Remove module

Remove the extension block while leaving the core and unrelated modules intact.

install cookie -u

Examples

Examples are copyable command lines, not actions executed by this website. Review paths, permissions and destructive flags before running them on a real project.

List visible cookie names
cookie
Short alias for cookie
coo
Show non-sensitive values
cookie -a
Inspect one cookie
cookie theme
Inspect one cookie
cookie theme -a
Inspect one cookie
cookie tracking -a
Inspect one cookie
cookie session_token -a
Inspect one cookie
cookie PHPSESSID
Inspect one cookie
cookie unknown
Delete one cookie
cookie theme -d
Delete one cookie
cookie unknown -d
Clear visible cookies without closing the session
cookie -c
Export non-sensitive cookies to JSON
cookie export -o sandbox/cookies-export.json
Export non-sensitive cookies to JSON
cookie export -o sandbox/cookies-export.json
Import safe cookies; -r overwrites conflicts
cookie import sandbox/cookies-safe.json
Import safe cookies; -r overwrites conflicts
cookie import sandbox/cookies-safe.json -r
Import safe cookies; -r overwrites conflicts
cookie import sandbox/cookies-unsafe.json
Import safe cookies; -r overwrites conflicts
cookie import sandbox/cookies-bad.json
Import safe cookies; -r overwrites conflicts
cookie import sandbox/cookies-missing.json
List visible cookie names
cookie -z

Related documentation

Current public release

v1.1.22026-11-01

Production refinement

Current stable release of cookie. A cookie is a small value the browser sends along with a request.