Solved

How do I both send a Cookie and redirect the browser

Posted on 1998-10-10
4
127 Views
Last Modified: 2013-12-25
How do I both send a Cookie and redirect the browser

       Send "Content-type: text/html"
       Send "Set-Cookie: Skattejagt=user; path=/;"
       Send "Location: " & SetTreasure
       Send ""
0
Comment
Question by:jfl
  • 2
4 Comments
 

Expert Comment

by:bver
ID: 1829022
You should not send both content-type and location entity-headers back to a client because these headers are exclusive.

The response should be rather:

       Send "Location: " & SetTreasure
       Send "Set-Cookie: Skattejagt=user; path=/;"
       Send "" 

assuming SetTreasure variable contains a valid URI for the redirection target.


0
 

Author Comment

by:jfl
ID: 1829023
The browser is not setting a cookie if I redirect
0
 
LVL 5

Accepted Solution

by:
aioudine earned 10 total points
ID: 1829024
require("cgilib.pl");
$SetTreasure = "HTTP://WWW.NOVELL.COM";
print "Set-Cookie: user=aioudine; path=/;";
print &PrintHeader;
print "<META http-equiv=\"refresh\" content=\"0;url=".$SetTreasure."\">";
---- end----
0
 

Author Comment

by:jfl
ID: 1829025
I have thought about that too, but it's not preferable
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Groovy:unable to resolve class error 2 95
AutoHotkey ActiveX Component Error 8 85
Batch script to move disabled user accounts to different OU 5 75
Where do I learn ES6? 3 66
I hope you'll find this tutorial useful and interesting. So let's try to extend Tcl with a new package.  For anyone more deeply interested please check out the book "Practical Programming in Tcl and Tk". It's really one of the best written books abo…
It is a general practice to get rid of old user profiles on a computer  in a LAN environment. As I have been working with a company in a LAN environment where users move from one place to some other place at times. This will make many user profil…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question