Roxen.git/
server/
etc/
modules/
Roxen.pmod
Branch:
Tag:
Non-build tags
All tags
No tags
2018-01-03
2018-01-03 10:38:23 by Henrik Grubbström (Grubba) <grubba@grubba.org>
832ed262751867b1d8e250c00c6f8b91bbfd6bdf (
48
lines) (+
41
/-
7
)
[
Show
|
Annotate
]
Branch:
832ed262751867b1d8e250c00c6f8b91bbfd6bdf
Documentation
[Roxen.set_cookie]
: Document all args.
5080:
//! Set the cookie specified by @[name] to @[value]. Adds a Set-Cookie //! header in the response that will be made from @[id]. //!
+
//! @param id
+
//! @[RequestID] for which to set the cookie.
+
//!
+
//! @param name
+
//! Name of the cookie.
+
//!
+
//! @param value
+
//! Value of the cookie.
+
//!
//! @param expire_time_delta
-
//!
If
the
expire_time_delta
variable
is
-1,
the
cookie
is set to
-
//!
expire
five
years
in the future
.
-2
will
set
the
expiration
time
to
-
//!
posix
time
1
and
add
the
argument
Max-Age,
set
to
0.
If expire_time_delta
-
//!
is
0
or ommited, no expire information is sent to the client. This
-
//!
usualy
results
in
the cookie being kept until the browser is exited.
+
//!
@int
+
//!
@value
1..
+
//!
Number of seconds
in the future
that
the cookie
will
expire.
+
//!
@value 0
+
//!
@value
UNDEFINED
+
//!
If
@[
expire_time_delta
]
is
@expr{0@}
or ommited, no expire
+
//!
information is sent to the client. This
usually results in
+
//!
the cookie being kept until the browser is exited.
+
//! @value -1
+
//! Expire five years in the future.
+
//! @value -2
+
//! Set the expiration time to POSIX time @expr{1@}, and set
+
//! the cookie Max-Age to @expr{0@}. Ie immediate expiry.
+
//! @endint
//!
-
+
//! @param domain
+
//! Extend the scope of the cookie to this domain.
+
//!
//! @param path //! A path argument will always be added to the Set-Cookie header unless
-
//! @[path] is
1
. It will otherwise be set to the provided string, or ""
-
//!
if no string is provided.
+
//! @[path] is
@expr{1@}
. It will otherwise be set to the provided string,
+
//!
or
@expr{
""
@}
if no string is provided.
+
//!
+
//! @param secure
+
//! Instruct the client to only provide the cookie over https connections.
+
//!
+
//! @param httponly
+
//! Instruct the client to not make the cookie available to client-side
+
//! scripting (ie Javascript).
+
//!
+
//! @note
+
//! The @[value] of the cookie will be passed through
+
//! @[http_encode_cookie()] before being sent to the client
+
//! this may affect client-side use of the cookie value.
{ if( expire_time_delta == -1 ) expire_time_delta = (3600*(24*365*5));