diff options
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/man3/http_cookie_create.3 | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/doc/man3/http_cookie_create.3 b/doc/man3/http_cookie_create.3 index 3ed78be..c439d91 100644 --- a/doc/man3/http_cookie_create.3 +++ b/doc/man3/http_cookie_create.3 @@ -1,4 +1,4 @@ -.TH HTTP_COOKIE_CREATE 3 2024-08-22 0.4.0 "libweb Library Reference" +.TH HTTP_COOKIE_CREATE 3 2026-02-12 0.6.0 "libweb Library Reference" .SH NAME http_cookie_create \- creates a HTTP/1.1 cookie @@ -8,7 +8,7 @@ http_cookie_create \- creates a HTTP/1.1 cookie .nf #include <libweb/http.h> .P -char *http_cookie_create(const char *\fIkey\fP, const char *\fIvalue\fP); +char *http_cookie_create(const char *\fIkey\fP, const char *\fIvalue\fP, const struct tm *\fIexp\fP); .fi .SH DESCRIPTION @@ -19,7 +19,13 @@ defined by .I key and .IR value , -which are null-terminated strings. +which are null-terminated strings, with an optional expiration date defined by +.IR exp . + +If +.I exp +is a null pointer, no expiration date is set to the cookie, and therefore it +effectively acts as a session cookie. .SH RETURN VALUE On success, a null-terminated string with the newly HTTP/1.1 cookie is @@ -34,11 +40,13 @@ A successful call to with .I ExampleValue as -.I key -and +.IR key , .I ExampleValue as .I value +and +.I exp +pointing to a given calendar time might return a null-terminated string such as the one below: .LP @@ -48,19 +56,11 @@ ExampleHeader=ExampleValue; HttpOnly; Expires Wed, 07 Sep 2023 00:00:00 GMT .EE .in -.SH FUTURE DIRECTIONS - -.I libweb -sets a 1-year expiration date for HTTP cookies due to arbitrary design -limitations. Future versions of this library shall allow a custom -expiration date as an additional parameter to -.IR http_cookie_create (3). - .SH SEE ALSO .BR libweb_http (7). .SH COPYRIGHT -Copyright (C) 2023-2024 libweb contributors +Copyright (C) 2023-2026 libweb contributors .P This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by |
