跳至主要內容
OCLC Support

Option Cookie, Option DomainCookieOnly, Option NoCookie, Option CookiePassThrough

Learn about the Option Cookie config.txt directives available in EZproxy.

A cookie is a piece of information sent by a web server to a web browser. A cookie contains a name and value, may contain a path, and may contain a domain. When a cookie is set by a web server using HTTP Set-Cookie, EZproxy inspects the cookie to determine if it contains a domain. If a domain is not included, the cookie is passed through unchanged and processed normally. If a domain is present, special processing is required. Consider the web server www.somedb.com requesting to set a cookie in the somedb.com domain. The EZproxy URL may be www.somedb.com.ezproxy.yourlib.org, which is not within the somedb.com domain. To handle this discrepancy, EZproxy stores the requested value of the cookie within its own user session, blocking the cookie from reaching the remote user’s browser. When placing requests for other web pages, EZproxy adds these domain cookies into the request sent to the remote web server.

Option Cookie is the default behavior for EZproxy when handling cookies. With this option enabled, EZproxy will pass through cookies that do not include a domain, but intercept and handle cookies that do include a domain. The intercepted cookies are stored as part of the user session on the EZproxy server.

Option DomainCookieOnly specifies that EZproxy should attempt to perform all cookie handling itself, without involving remote user’s browser in cookie handling. The name of this option is somewhat misleading since it actually directs EZproxy to handle both domain and non- domain cookies. All cookies that are set by the web server using HTTP Set -Cookie will be stored by EZproxy and sent back to the remote web server without being presented to the remote user’s browser. Cookies set by JavaScript are blocked from reaching the remote web server.

Option NoCookie directs EZproxy to prevent any cookies from being forwarded from the browser to the remote web server, and also prevents EZproxy from sending any cookies that are stored as part of the user’s session to the remote web server.

Option CookiePassThrough If there is a domain referenced on the cookie, the EZproxy server changes that domain to the EZproxy server's domain (yourlib.org) and passes it to the browser.

These config.txt directives are repeatable and position-dependent. They interact with database stanzas.

Examples

Access to Some Database will use special processing where all cookie handling is handled directly by EZproxy. Standard cookie processing is then restored for Other Database and any other databases that appear after Other Database.

Option DomainCookieOnly
Title Some Database
URL http://www.somedb.com
Domain somedb.com
Option Cookie
Title Other Database
URL http://www.otherdb.com
Domain otherdb.com

Related directives 

CookieFilter