Skip to main content
Version: 7.2405.x.x LTS

CookieCacheFilter

This filter permits controlling the caching of cookies sent by the content provider. When cookies are cached, they are not forwarded to the browser, but merged with each incoming request before propagation to a content provider instead.

The rules which define how to handle cookies are defined in the configuration attribute CookieManager and are evaluated in the order of their appearance. The rules can be set as follows:

<rule>:<regexp>

The following rules are allowed:

  • store: The cookie sent by the content provider is stored within nevisProxy. The client is not allowed to send the cookie to the application.
  • retain: If a session exists, the specified cookie is stored ("store"), otherwise, it is sent to the client ("allow"). If the connector is used simultaneously for unprotected and protected content, we recommend storing all cookies (that is, using a "store" rule, instead of "retain").
  • block: The cookie sent by the content provider or the client is blocked, that is, ignored.
  • allow: The cookie sent by the content provider, or the client, will be allowed to pass through if there is no matching "store" or "block" rule.

The regular expression is optional. If not configured, all cookies are matching. The CookieManager can be disabled by configuring:

<param-value>off</param-value>
Example:
store:^JSESSIONID$
store:^Navajo$
allow:^.*Language$
block:^.Session.$

To find out which cookies are set by content providers, either enable cookie warnings in your browser, or enable NavajoOp tracing (NavajoOp=1) and monitor 'Set-Cookie' HTTP headers.

Classname
'ch::nevis::isiweb4::filter::cookie::CookieCacheFilter'

Library

libCookieFilters.so.1

Configuration

CookieManager

Type: string, newline separated
Usage Constraint: required

This attribute configures the caching of cookies sent by the content provider. The mode of the CookieManager attribute can be set as follows:
<rule>:<regexp>
The following rules are allowed: store, retain, block, allow.
The default <regex> type is PCRE(da).

The rules are executed in the order they appear in the configuration. The first matching rule is applied. Cookies that do not match any rule are blocked. The CookieManager can be disabled by configuring off.

CookieManager.PassthroughParsed

Type: boolean
Usage Constraint: optional
Default: true

If set to "true", the cookies that are allowed to be passed through will be parsed and serialized according to RFC 6265.

CookieManager.DefaultCookiePath

Type: string
Usage Constraint: optional
Default: "/"

This attribute sets the default cookie path to the defined string. If no cookie path is selected, no cookie path will be set.

SynchronizeSessions

Type: boolean
Usage Constraint: optional, advanced
Default: false

If set to true, nevisProxy will synchronize the sessions. This is to avoid the collision of cookies in case two (or more) requests within the same session access the back end at the same time.

SynchronizeSessions.timeoutMSec

Type: integer
Usage Constraint: optional, advanced

Defines the maximum time period in milliseconds to wait if a concurrent session is trying to get/set cookies from the back end as well. If you do not set this parameter, requests within the same session must possibly wait until all back ends have sent their cookies. This can slow down all requests if the back end is slow.
This parameter is only evaluated if SynchronizeSessions is set to true.

Example
<filter>
<filter-name>CookieCacheFilter</filter-name>
<filter-class>ch::nevis::isiweb4::filter::cookie::CookieCacheFilter</filter-class>
<init-param>
<param-name>CookieManager</param-name>
<param-value>
allow:^LANG$
store:^.*$
</param-value>
</init-param>
</filter>