From bbeceee2b8a81b68f8c100c8b019f23c43b7ec10 Mon Sep 17 00:00:00 2001 From: Ground0 Date: Mon, 30 Sep 2024 17:07:24 +0200 Subject: [PATCH] Session Handling initial --- inc/lweb_header_privat.pbi | 5 +++++ lweb.pbi | 7 +++++++ lweb.pbp | 18 +++++++++--------- 3 files changed, 21 insertions(+), 9 deletions(-) diff --git a/inc/lweb_header_privat.pbi b/inc/lweb_header_privat.pbi index c1194ec..3025546 100644 --- a/inc/lweb_header_privat.pbi +++ b/inc/lweb_header_privat.pbi @@ -107,6 +107,10 @@ perm.i EndStructure + Structure session + Cookie.s + EndStructure + Structure host description.s http.server_http @@ -117,6 +121,7 @@ Map dynamichandler.dynamichandler() Map usedlibs.usedlibs() Map headerfunctions.headerfunctions() + Map sessions.session() defaultfile.s basedir.s Map status.http_status_codes() ;Individual Error Messages and Headers diff --git a/lweb.pbi b/lweb.pbi index ecf0682..95a1a20 100644 --- a/lweb.pbi +++ b/lweb.pbi @@ -702,6 +702,13 @@ Module lhs_web ;TODO: Header Handler ; ex. Cookie: #http_head_cookie + If Header(#http_head_cookie) <> "" + ldl::Logging("Session:"+Header(#http_head_cookie)) + + Else + Header(#http_head_cookie) = CreateUUID() + configuration\hosts(m_clients(Str(thread_cli_id))\host_id)\sessions(Header(#http_head_cookie))\Cookie = Header(#http_head_cookie) + EndIf Select Header(#http_head_method) Case #http_method_get diff --git a/lweb.pbp b/lweb.pbp index d0feeec..2f8ea7e 100644 --- a/lweb.pbp +++ b/lweb.pbp @@ -8,7 +8,7 @@
- +
@@ -29,12 +29,16 @@ - + + + + + @@ -87,10 +91,6 @@ - - - - @@ -105,7 +105,7 @@ - + @@ -145,7 +145,7 @@ - + @@ -154,7 +154,7 @@ - +