summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFulup Ar Foll <fulup@iot.bzh>2015-12-29 02:15:07 +0100
committerManuel Bachmann <manuel.bachmann@iot.bzh>2015-12-29 02:15:26 +0100
commitda9b5d47f01f786f3170c80724a1a6d8f9b94ebb (patch)
treee5183502c07df8a8597a9f13a3d06c6190371147 /src
parent07c775201fbd9477bd4a69cee3d48a95eb612bc6 (diff)
Switch to unique token model
Token/Session Plugin is now able to issue a globally-valid token (re-useable with all Plugins, so that an application using multiple plugins is not forced to manage multiple tokens anymore). Adapt Audio & Radio Plugins to this model (init functions do not create a token anymore, check for a prior existing one). Signed-off-by: Manuel Bachmann <manuel.bachmann@iot.bzh> Author: Fulup Ar Foll <fulup@iot.bzh> Author: Manuel Bachmann <manuel.bachmann@iot.bzh>
Diffstat (limited to 'src')
-rw-r--r--src/rest-api.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/rest-api.c b/src/rest-api.c
index 398ba577..2596f305 100644
--- a/src/rest-api.c
+++ b/src/rest-api.c
@@ -510,7 +510,7 @@ ProcessApiCall:
// client did not pass token on URI let's use cookies
if ((!request->restfull) && (request->context != NULL)) {
char cookie[64];
- snprintf (cookie, sizeof (cookie), "%s=%s", COOKIE_NAME, request->uuid);
+ snprintf (cookie, sizeof (cookie), "%s=%s;path=/api;max-age=%d", COOKIE_NAME, request->uuid, request->config->cntxTimeout);
MHD_add_response_header (webResponse, MHD_HTTP_HEADER_SET_COOKIE, cookie);
}