Solved

How do I both send a Cookie and redirect the browser

Posted on 1998-10-10
4
129 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Making a simple AJAX shopping cart Couple years ago I made my first shopping cart, I used iframe and JavaScript, it was very good at that time, there were no sessions or AJAX, I used cookies on clients machine. Today we have more advanced techno…
Recently I have been answering a lot of questions like this in IT forums that I frequent. The question posed is usually something along the lines of "We have software X installed and need to uninstall it for reason Y" or some other variant of the sa…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
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…

738 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