HTTP cookie helpers.
最初に以下の最小例でモジュール利用方法を確認し、その後 API リファレンスを参照してください。
from nexom.app.cookie import *
# このモジュールの関数・クラスを用途に合わせて呼び出します。
# 下の API リファレンスで各関数の引数と使い方を確認してください。
分類: public class
Represents a single HTTP cookie.
分類: special method
__init__(self, name: str, value: str, *, http_only: bool = True, secure: bool = True, **kwargs: str | int | None) -> None
メソッドドキュメントは未定義です。
name / kind=positional-or-keyword / type=str / 必須 / default=なしvalue / kind=positional-or-keyword / type=str / 必須 / default=なしhttp_only / kind=keyword-only / type=bool / 任意 / default=Truesecure / kind=keyword-only / type=bool / 任意 / default=Truekwargs / kind=variadic-keyword(**kwargs) / type=str | int | None / 必須 / default=なしNone
実装コード内の例外仕様を確認してください。
from nexom.app.cookie import Cookie
obj = Cookie(name="sample", value="sample", http_only=True, secure=True)
分類: special method
__repr__(self) -> str
メソッドドキュメントは未定義です。
str
実装コード内の例外仕様を確認してください。
from nexom.app.cookie import Cookie
obj = Cookie(...)
result = obj.__repr__()
print(result)
分類: special method
__str__(self) -> str
メソッドドキュメントは未定義です。
str
実装コード内の例外仕様を確認してください。
from nexom.app.cookie import Cookie
obj = Cookie(...)
result = obj.__str__()
print(result)
分類: public method
set(self, key: str, value: str | int) -> None
Add or update an attribute of the cookie.
key / kind=positional-or-keyword / type=str / 必須 / default=なしvalue / kind=positional-or-keyword / type=str | int / 必須 / default=なしNone
実装コード内の例外仕様を確認してください。
from nexom.app.cookie import Cookie
obj = Cookie(...)
result = obj.set(key="sample", value="sample")
print(result)
分類: public method
to_header(self) -> str
Return the cookie string for Set-Cookie header.
str
実装コード内の例外仕様を確認してください。
from nexom.app.cookie import Cookie
obj = Cookie(...)
result = obj.to_header()
print(result)
分類: public method
response(self, body: str | bytes = 'OK') -> Response
Generate a Response object with this cookie set.
body / kind=positional-or-keyword / type=str | bytes / 任意 / default='OK'Response
実装コード内の例外仕様を確認してください。
from nexom.app.cookie import Cookie
obj = Cookie(...)
result = obj.response(body='OK')
print(result)
分類: public class
Container for cookies parsed from a request.
分類: special method
__init__(self, **kwargs: str) -> None
メソッドドキュメントは未定義です。
kwargs / kind=variadic-keyword(**kwargs) / type=str / 必須 / default=なしNone
実装コード内の例外仕様を確認してください。
from nexom.app.cookie import RequestCookies
obj = RequestCookies()
分類: public method
get(self, key: str, default: str | None = None) -> str | None
メソッドドキュメントは未定義です。
key / kind=positional-or-keyword / type=str / 必須 / default=なしdefault / kind=positional-or-keyword / type=str | None / 任意 / default=Nonestr | None
実装コード内の例外仕様を確認してください。
from nexom.app.cookie import RequestCookies
obj = RequestCookies(...)
result = obj.get(key="sample", default=None)
print(result)
nexom.app.cookieservices/venv/lib/python3.10/site-packages/nexom/app/cookie.py2026-03-14