[Gambas-user] SetCookie/DeleteCookie

Hans Lehmann hans at gambas-buch.de
Mon Jan 4 16:37:21 CET 2021


since my request to set a cookie from a WebPage did not find an answer 
so far, I present my source code in excerpts:

The class site.class contains among others this procedure:

Public Sub Set_Cookie()

   Dim dExpires As Date

   dExpires = DateAdd(Now(), gb.Minute, 30)
   Response.SetCookie("GBB", "Osterburg", "", "/", dExpires, True)


and here the content of the file site.webpage:

<!DOCTYPE html>
<html lang="de">


     <meta charset="utf-8">
     <meta name="viewport" content="width=device-width, 
initial-scale=1.0, shrink-to-fit=no">
     <link rel="stylesheet" type="text/css" href="css/style.css">
     <link rel="shortcut icon" type="image/x-icon" 
     <script src="js/time.js" charset="utf-8"></script>
   <body onload="startTime()">
     <div class=header0>
       <h1>Aktuelle Zeit: </h1><h1 id="current_time"></h1>
     <% PrintDBTable() %>

Unfortunately no cookie is set. Therefore the question: Where is the error?

With kind regards


More information about the User mailing list