473,396 Members | 2,011 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Python CGI problem: correct result, but incorrect browser response.

title:Python CGI problem: correct result, but incorrect browser
response.

In one of my CGI program,named 'login.py', the script return a HEADER
to web browser:

Set-Cookie: sessionID=LAABUQLUCZIQJTZDWTFE;
Set-Cookie: username=testuser;
Status:302
Location:edit.py
(blank line)

but the IE prompted to let me choose to save the 'login.py'. When I
save it, the file is just the header. That means the IE failed to parse
the header. My IE has already enabled cookie read and write. I also
tried Firefox, but the result is the same. How does this happen?

Apr 6 '06 #1
1 1505
"Sullivan WxPyQtKinter" <su***********@gmail.com> wrote:

title:Python CGI problem: correct result, but incorrect browser
response.

In one of my CGI program,named 'login.py', the script return a HEADER
to web browser:

Set-Cookie: sessionID=LAABUQLUCZIQJTZDWTFE;
Set-Cookie: username=testuser;
Status:302
Location:edit.py
(blank line)

but the IE prompted to let me choose to save the 'login.py'. When I
save it, the file is just the header. That means the IE failed to parse
the header. My IE has already enabled cookie read and write. I also
tried Firefox, but the result is the same. How does this happen?


Perhaps you should show us the script. Is it possible that you have
already printed a "Content-Type" header and blank line before these
headers, or perhaps just a blank line? Remember that this will fail:

print """
Set-Cookie: sessionID=LAABUQLUCZIQJTZDWTFE;
Set-Cookie: username=testuser;
Status:302
Location:edit.py
"""

because you get a blank line first, which terminates the headers.
--
- Tim Roberts, ti**@probo.com
Providenza & Boekelheide, Inc.
Apr 7 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

699
by: mike420 | last post by:
I think everyone who used Python will agree that its syntax is the best thing going for it. It is very readable and easy for everyone to learn. But, Python does not a have very good macro...
467
by: mike420 | last post by:
THE GOOD: 1. pickle 2. simplicity and uniformity 3. big library (bigger would be even better) THE BAD:
117
by: Peter Olcott | last post by:
www.halting-problem.com
47
by: Kenneth McDonald | last post by:
Is there any emerging consensus on the "best" UI for toolkit. Tk never quite made it but from what I can see, both qt and wxWin are both doing fairly well in general. I'm already aware of the...
5
by: Vishal | last post by:
Hello, I already asked this question in the ASP.NET forums, but no help came. So I am hoping that somebody can help me out. This is really very URGENT me. For my e-commerce application, I...
6
by: Ammar | last post by:
Dear All, I'm facing a small problem. I have a portal web site, that contains articles, for each article, the end user can send a comment about the article. The problem is: I the comment length...
27
by: Josh | last post by:
We have a program written in VB6 (over 100,000 lines of code and 230 UI screens) that we want to get out of VB and into a better language. The program is over 10 years old and has already been...
22
by: Dan Rumney | last post by:
Hi all, I've been writing Javascript for quite a while now and have, of late, been writing quite a lot of AJAX and AJAX-related code. In the main, my dynamically generated pages are created...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.