nginx

Module ngx_http_userid_module


english
русский

简体中文
עברית
日本語
türkçe

news
about
download
security advisories
documentation
pgp keys
faq
links
books
support
donation

trac
wiki
twitter
nginx.com
This translation may be out of date. Check the English version for recent changes.
Example Configuration
Directives
     userid
     userid_domain
     userid_expires
     userid_name
     userid_p3p
     userid_path
     userid_service

The ngx_http_userid_module module sets cookies suitable for client identification. Received and set cookies can be logged using the embedded variables $uid_got and $uid_set. This module is compatible with the mod_uid module for Apache.

Example Configuration

userid         on;
userid_name    uid;
userid_domain  example.com;
userid_path    /;
userid_expires 365d;
userid_p3p     'policyref="/w3c/p3p.xml", CP="CUR ADM OUR NOR STA NID"';

Directives

syntax: userid on | v1 | log | off;
default:
userid off;
context: http, server, location

Allows or prohibits to set cookies and log the received cookies:

on
allows to set version 2 cookies and log the received cookies;
v1
allows to set version 1 cookies and log the received cookies;
log
prohibits to set cookies but allows to log the received cookies;
off
prohibits to set cookies and log the received cookies.

syntax: userid_domain name | none;
default:
userid_domain none;
context: http, server, location

Defines a domain for which the cookie is set. The parameter none disables setting a domain for a cookie.

syntax: userid_expires time | max;
default:
context: http, server, location

Sets a time during which a browser should keep the cookie. The parameter max sets the time to “31 Dec 2037 23:55:55 GMT”. This is the maximum time understood by old browsers.

syntax: userid_name name;
default:
userid_name uid;
context: http, server, location

Sets a cookie name.

syntax: userid_p3p string;
default:
context: http, server, location

Sets a value for the “P3P” header field that will be sent along with a cookie.

syntax: userid_path path;
default:
userid_path /;
context: http, server, location

Defines a path for which the cookie is set.

syntax: userid_service number;
default:
userid_service IP address of the server;
context: http, server, location

Identifies the service that set a cookie. For version 1 cookies the default value is zero. For version 2 cookies the default value is an IP address of the server.