From 9f6adf7a98741f53f141f42e8627fb8a47e10cb4 Mon Sep 17 00:00:00 2001 From: Martin Preuss Date: Mon, 15 Sep 2025 19:34:56 +0200 Subject: [PATCH] renew session cookie. --- apps/aqhome-cgi/modules/common/mservice.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/apps/aqhome-cgi/modules/common/mservice.c b/apps/aqhome-cgi/modules/common/mservice.c index 26326cf..6f409c9 100644 --- a/apps/aqhome-cgi/modules/common/mservice.c +++ b/apps/aqhome-cgi/modules/common/mservice.c @@ -335,6 +335,7 @@ AQH_SESSION *AQH_ModService_ReadSession(AQH_MODULE *m, AQCGI_REQUEST *rq) } else { const char *sUserName; + GWEN_BUFFER *tbuf; sUserName=AQH_Session_GetUserAlias(session); if (sUserName && *sUserName) { @@ -351,6 +352,13 @@ AQH_SESSION *AQH_ModService_ReadSession(AQH_MODULE *m, AQCGI_REQUEST *rq) } AQH_Session_SetUser(session, user); } + /* renew session cookie */ + + tbuf=GWEN_Buffer_new(0, 256, 0, 1); + GWEN_Buffer_AppendArgs(tbuf, "Set-Cookie: session=%s; max-age=3600", AQH_Session_GetUid(session)); + AQCGI_Request_AddResponseHeaderData(rq, GWEN_Buffer_GetStart(tbuf)); + DBG_ERROR(NULL, "Renew session cookie"); + GWEN_Buffer_free(tbuf); return session; } }