summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@iot.bzh>2016-02-11 14:25:45 +0100
committerJosé Bollo <jose.bollo@iot.bzh>2016-02-11 14:25:45 +0100
commit96b44f68e34f41c145b54ad2f7c4051c7d07ecb0 (patch)
tree8806471ad6414eb7df2de851182c36d6c91df43b
parent0d81cd0332e72d6c2ed91dc58184229a92b28196 (diff)
session: reset the timestamp on refresh
Change-Id: Id685bcfa91791427a92aa69eb70cfcd1f8766e46 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
-rw-r--r--src/session.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/session.c b/src/session.c
index 781ecd94..6aa018b1 100644
--- a/src/session.c
+++ b/src/session.c
@@ -582,6 +582,10 @@ PUBLIC AFB_error ctxTokenRefresh (AFB_clientCtx *clientCtx, AFB_request *request
// Old token was valid let's regenerate a new one
uuid_generate(newuuid); // create a new UUID
uuid_unparse_lower(newuuid, clientCtx->token);
+
+ // keep track of time for session timeout and further clean up
+ clientCtx->timeStamp=time(NULL);
+
return (AFB_SUCCESS);
}