Consultor Eletrônico



Kbase P5150: How to set a cookie using embedded speedscript
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   15/10/2008
Status: Verified

GOAL:

How to set cookie using embedded speedscript

FACT(s) (Environment):

WebSpeed 3.1x

FIX:

The following example shows how to set a cookie using embedded speedscript:


<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<meta name="AUTHOR" content="Your Name">
<title>WebSpeed Script</title>
</head>
<body>
<script language="SpeedScript">
If get-cookie('mycookie') = ""
 then do :
   PROCEDURE output-headers :
     set-cookie ("mycookie","customer's cookie", ?, ?, ?, ?, ?).
     output-http-header ("Pragma","No-Cache").
     output-http-header ("Expires","0").
     output-content-type ("text/html":U).
   END PROCEDURE.
 end.
 else do :
   {&out} 'This is the cookievalue : ' get-cookie('mycookie').
 end.
 </script>

<form action="setcookieself.r" method="POST">
<p><center>This is to get the cookie name
  <input type="submit" name="B1" value="Submit">
</center></p>
</form>
</body>
</html>