このページは、まだ日本語ではご利用いただけません。翻訳中です。
古いプラグインバージョンのドキュメントを閲覧しています。
構成
このプラグインは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
パラメータ
このプラグインの設定で使用できるすべてのパラメータのリストは次のとおりです。
-
string required
プラグイン名。この場合は
session
。- Kong Admin API、Kong Konnect API、宣言型構成、または decK ファイルを使用する場合、フィールドは
name
です。 - Kubernetes で KongPlugin オブジェクトを使用する場合、フィールドは
plugin
です。
- Kong Admin API、Kong Konnect API、宣言型構成、または decK ファイルを使用する場合、フィールドは
-
string
プラグインのインスタンスを識別するための任意のカスタム名 (例:
session_my-service
。インスタンス名はKong ManagerとKonnectに表示されるので、 例えば複数のサービスで同じプラグインを複数のコンテキストで実行する場合に便利です。また、Kong Admin API経由で特定のプラグインインスタンスに アクセスするためにも使用できます。
インスタンス名は、次のコンテキスト内で一意である必要があります。
- Kong Gateway Enterpriseのワークスペース内
- Konnectのコントロールプレーン(CP)またはコントロールプレーン(CP)グループ内
- Kong Gateway (OSS)の全世界
-
string
プラグインが対象とするサービス名または ID。最上位の
/plugins
エンドポイント. からプラグインをサービスに追加する場合は、これらのパラメータのいずれかを設定してください/services/{serviceName|Id}/plugins
を使用する場合は必要ありません。 -
string
プラグインがターゲットとするルート名または ID。最上位の
/plugins
エンドポイント. を通るルートにプラグインを追加する場合は、これらのパラメータのいずれかを設定してください/routes/{routeName|Id}/plugins
を使用する場合は必要ありません。 -
boolean default:
true
このプラグインが適用されるかどうか。
-
record required
-
string referenceable encrypted default:
beRbEfhfh8hVrEdj5Qmbt4xkUVH2ZCtKf9FPbRQBhLww
The secret that is used in keyed HMAC generation.
-
string default:
cookie
Must be one of:cookie
,kong
Determines 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.
-
string default:
default
The session audience, which is the intended target application. For example
"my-application"
.
-
number default:
900
The session cookie idle time, in seconds.
-
number default:
3600
The session cookie rolling timeout, in seconds. Specifies how long the session can be used until it needs to be renewed.
-
number default:
86400
The session cookie absolute timeout, in seconds. Specifies how long the session can be used until it is no longer valid.
-
number default:
10
The 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.
-
string default:
session
The name of the cookie.
-
string default:
/
The resource in the host where the cookie is available.
-
string
The domain with which the cookie is intended to be exchanged.
-
string default:
Strict
Must be one of:Strict
,Lax
,None
,Default
Determines 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. -
None
oroff
: Disables the same-site attribute so that a cookie may be sent with cross-site requests.None
requires the Secure attribute (cookie_secure
) in latest browser versions. For more info, see the SameSite cookies docs on MDN.
-
-
boolean default:
true
Applies the
HttpOnly
tag so that the cookie is sent only to a server. See the Restrict access to cookies docs on MDN.
-
boolean default:
true
Applies 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.
-
boolean default:
false
Enables or disables persistent sessions.
-
string default:
remember
Persistent session cookie name. Use with the
remember
configuration parameter.
-
number default:
604800
The persistent session rolling timeout window, in seconds.
-
number default:
2592000
The persistent session absolute timeout limit, in seconds.
-
set of type
string
Must be one of:id
,audience
,subject
,timeout
,idling-timeout
,rolling-timeout
,absolute-timeout
List 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-Id
andSession-Timeout
in the response headers.
-
set of type
string
Must be one of:id
,audience
,subject
,timeout
,idling-timeout
,rolling-timeout
,absolute-timeout
List 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-Id
andSession-Timeout
in the request headers.
-
set of type
string
default:POST, DELETE
Must be one of:GET
,POST
,DELETE
The methods that may be used to end sessions: POST, DELETE, GET.
-
string default:
session_logout
The query argument passed to logout requests.
-
string default:
session_logout
The POST argument passed to logout requests. Do not change this property.
-
-
number
Deprecation notice:
-
number
Deprecation notice:
-
number
Deprecation notice:
-
number
Deprecation notice:
-
string
Deprecation notice:
-
boolean
Deprecation notice:
-
boolean
Deprecation notice: