]> SAFE projects GIT repository - jmp/mailleur/commitdiff
able to set cookies
authorJean-Marc Pigeon <jmp@safe.c>
Wed, 3 Sep 2025 23:11:05 +0000 (19:11 -0400)
committerJean-Marc Pigeon <jmp@safe.c>
Wed, 3 Sep 2025 23:11:05 +0000 (19:11 -0400)
www/gessql.php
www/mailleur.php

index c982ce2a7004f0c2c4a225fa15856b523d3f7a6c..afedc9c65917ef7c44f513b6a1e65f47c2ea025e 100644 (file)
@@ -44,6 +44,9 @@ while ($proceed==true) {
     case 3      :       //compare crypted password adn given password
       break;
     case 4      :       //everything fine
+      $random=(string)rand(0,9999999); 
+      $uniqid=uniqid("",true);
+      setcookie(getenv("APPNAME"),"$random$uniqid",time()+(24*3600),"/");
       $isgood=true;
       break;
     default     :       //SAFE Guard
index 40d70453a5b29bda65b9ca3458a3baac6c9500f6..6085466efe234f9481d6f2e9a9e5490c441df73e 100644 (file)
@@ -17,7 +17,7 @@ include_once "unienv.php";
 include_once "scrfun.php";
 include_once "devsql.php";
 $footer=footer("mailleur");
-$cook=$_COOKIE["ABC"];
+$cook=$_COOKIE[getenv("APPNAME")];
 rou_closelog();
 
 
@@ -38,8 +38,6 @@ Login=$logname
 <BR>
 Password=$pass
 <BR>
-The Password=$data
-<BR>
 The cookies=$cook
 <BR>
 </FONT></STRONG></CENTER>
@@ -53,18 +51,10 @@ EOT;
 return $STR;
 }
 
-if (defined('JMPDBG')) {
-  $action="login";
-  $logname="postmaster@example.com";
-  $pass="postmaster";
-  }
-else {
-  //extracting POST variables
-  $epost="_POST";
-  $action=${$epost}["action"];
-  $logname=${$epost}["email"];
-  $pass=${$epost}["passwd"];
-  }
+$epost="_POST";
+$action=${$epost}["action"];
+$logname=${$epost}["email"];
+$pass=${$epost}["passwd"];
 
 //display main screen
 echo body($action,$logname,$pass);