session: reset the timestamp on refresh
authorJosé Bollo <jose.bollo@iot.bzh>
Thu, 11 Feb 2016 13:25:45 +0000 (14:25 +0100)
committerJosé Bollo <jose.bollo@iot.bzh>
Thu, 11 Feb 2016 13:25:45 +0000 (14:25 +0100)
Change-Id: Id685bcfa91791427a92aa69eb70cfcd1f8766e46
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
src/session.c

index 781ecd9..6aa018b 100644 (file)
@@ -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);    
     
 }