NPRPC docs

struct CookieOptions

C++

struct CookieOptions

Options for a Set-Cookie header.

include/nprpc/http_auth.hpp:41

Fields

std::string_view domain

Domain scope. Empty = current host only.

include/nprpc/http_auth.hpp:54

bool http_only = true

Prevent JS access (recommended for session tokens).

include/nprpc/http_auth.hpp:43

std::optional<int> max_age

Cookie lifetime in seconds. Omit (nullopt) for a session cookie.

include/nprpc/http_auth.hpp:50

std::string_view path = "/"

Path scope. Defaults to "/" (entire site).

include/nprpc/http_auth.hpp:52

std::string_view same_site = "Strict"

SameSite attribute — "Strict", "Lax", or "None". Use "None" together with secure=true for cross-site cookies.

include/nprpc/http_auth.hpp:48

bool secure = true

Only send over HTTPS.

include/nprpc/http_auth.hpp:45