このページは、まだ日本語ではご利用いただけません。翻訳中です。
古いプラグインバージョンのドキュメントを閲覧しています。
構成
このプラグインはDB-lessモードと部分的に互換性があります。
config.storage must be set to cookie. The kong strategy uses
a database, and is not supported. The plugin currently lacks checks
for this invalid configuration in DB-less mode.
互換性のあるプロトコル
Sessionプラグインは以下のプロトコルに対応しています:
grpc, grpcs, http, https, tcp, tls, tls_passthrough, udp, ws, wss
パラメータ
このプラグインの設定で使用できるすべてのパラメータのリストは次のとおりです。
-
name or plugin
string requiredプラグイン名。この場合は
session。- Kong Admin API、Kong Konnect API、宣言型構成、または decK ファイルを使用する場合、フィールドは
nameです。 - Kubernetes で KongPlugin オブジェクトを使用する場合、フィールドは
pluginです。
- Kong Admin API、Kong Konnect API、宣言型構成、または decK ファイルを使用する場合、フィールドは
-
instance_name
stringプラグインのインスタンスを識別するための任意のカスタム名 (例:
session_my-service。インスタンス名はKong ManagerとKonnectに表示されるので、 例えば複数のサービスで同じプラグインを複数のコンテキストで実行する場合に便利です。また、Kong Admin API経由で特定のプラグインインスタンスに アクセスするためにも使用できます。
インスタンス名は、次のコンテキスト内で一意である必要があります。
- Kong Gateway Enterpriseのワークスペース内
- Konnectのコントロールプレーン(CP)またはコントロールプレーン(CP)グループ内
- Kong Gateway (OSS)の全世界
-
service.name or service.id
stringプラグインが対象とするサービス名または ID。最上位の
/pluginsエンドポイント. からプラグインをサービスに追加する場合は、これらのパラメータのいずれかを設定してください/services/{serviceName|Id}/pluginsを使用する場合は必要ありません。 -
route.name or route.id
stringプラグインがターゲットとするルート名または ID。最上位の
/pluginsエンドポイント. を通るルートにプラグインを追加する場合は、これらのパラメータのいずれかを設定してください/routes/{routeName|Id}/pluginsを使用する場合は必要ありません。 -
enabled
boolean default:trueこのプラグインが適用されるかどうか。
-
config
record required-
secret
string referenceable encrypted default:beRbEfhfh8hVrEdj5Qmbt4xkUVH2ZCtKf9FPbRQBhLwwThe secret that is used in keyed HMAC generation.
-
storage
string default:cookieMust be one of:cookie,kongDetermines where the session data is stored.
kong: Stores encrypted session data into Kong’s current database strategy; the cookie will not contain any session data.cookie: Stores encrypted session data within the cookie itself.
-
audience
string default:defaultThe session audience, which is the intended target application. For example
"my-application".
-
idling_timeout
number default:900The session cookie idle time, in seconds.
-
rolling_timeout
number default:3600The session cookie rolling timeout, in seconds. Specifies how long the session can be used until it needs to be renewed.
-
absolute_timeout
number default:86400The session cookie absolute timeout, in seconds. Specifies how long the session can be used until it is no longer valid.
-
stale_ttl
number default:10The duration, in seconds, after which an old cookie is discarded, starting from the moment when the session becomes outdated and is replaced by a new one.
-
cookie_name
string default:sessionThe name of the cookie.
-
cookie_path
string default:/The resource in the host where the cookie is available.
-
cookie_domain
stringThe domain with which the cookie is intended to be exchanged.
-
cookie_same_site
string default:StrictMust be one of:Strict,Lax,None,DefaultDetermines whether and how a cookie may be sent with cross-site requests.
-
Strict: The browser sends cookies only if the request originated from the website that set the cookie. -
Lax: Same-site cookies are withheld on cross-domain subrequests, but are sent when a user navigates to the URL from an external site, for example, by following a link. -
Noneoroff: Disables the same-site attribute so that a cookie may be sent with cross-site requests.Nonerequires the Secure attribute (cookie_secure) in latest browser versions. For more info, see the SameSite cookies docs on MDN.
-
-
cookie_http_only
boolean default:trueApplies the
HttpOnlytag so that the cookie is sent only to a server. See the Restrict access to cookies docs on MDN.
-
cookie_secure
boolean default:trueApplies the Secure directive so that the cookie may be sent to the server only with an encrypted request over the HTTPS protocol. See the Restrict access to cookies docs on MDN.
-
remember
boolean default:falseEnables or disables persistent sessions.
-
remember_cookie_name
string default:rememberPersistent session cookie name. Use with the
rememberconfiguration parameter.
-
remember_rolling_timeout
number default:604800The persistent session rolling timeout window, in seconds.
-
remember_absolute_timeout
number default:2592000The persistent session absolute timeout limit, in seconds.
-
response_headers
set of typestringMust be one of:id,audience,subject,timeout,idling-timeout,rolling-timeout,absolute-timeoutList of information to include, as headers, in the response to the downstream.
Accepted values are:
id,audience,subject,timeout,idling-timeout,rolling-timeout, andabsolute-timeout.For example:
{ "id", "timeout" }injects bothSession-IdandSession-Timeoutin the response headers.
-
request_headers
set of typestringMust be one of:id,audience,subject,timeout,idling-timeout,rolling-timeout,absolute-timeoutList of information to include, as headers, in the request to the upstream.
Accepted values are:
id,audience,subject,timeout,idling-timeout,rolling-timeout, andabsolute-timeout.For example,
{ "id", "timeout" }sets bothSession-IdandSession-Timeoutin the request headers.
-
logout_methods
set of typestringdefault:POST, DELETEMust be one of:GET,POST,DELETEThe methods that may be used to end sessions: POST, DELETE, GET.
-
logout_query_arg
string default:session_logoutThe query argument passed to logout requests.
-
logout_post_arg
string default:session_logoutThe POST argument passed to logout requests. Do not change this property.
-
-
cookie_lifetime
numberDeprecation notice:
-
cookie_idletime
numberDeprecation notice:
-
cookie_renew
numberDeprecation notice:
-
cookie_discard
numberDeprecation notice:
-
cookie_samesite
stringDeprecation notice:
-
cookie_httponly
booleanDeprecation notice:
-
cookie_persistent
booleanDeprecation notice: