473,549 Members | 2,243 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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=LAABU QLUCZIQJTZDWTFE ;
Set-Cookie: username=testus er;
Status:302
Location:edit.p y
(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 1513
"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=LAABU QLUCZIQJTZDWTFE ;
Set-Cookie: username=testus er;
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=LAABU QLUCZIQJTZDWTFE ;
Set-Cookie: username=testus er;
Status:302
Location:edit.p y
"""

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
33351
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 capabilities, unfortunately. I'd like to know if it may be possible to add a powerful macro system to Python, while keeping its amazing syntax, and if it...
467
21254
by: mike420 | last post by:
THE GOOD: 1. pickle 2. simplicity and uniformity 3. big library (bigger would be even better) THE BAD:
117
7111
by: Peter Olcott | last post by:
www.halting-problem.com
47
3440
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 licensing issues surrounding qt (fwiw, I think their license fee for commercial use is eminently reasonable), so aside from that, I was wondering if...
5
3015
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 need to send data from my server via the post method to the payment server. The payment server does not run asp.net. I dont know what they run. The...
6
3789
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 is more that 1249 bytes, then the progress bar of the browser will move too slow and then displaying that the page not found!!!! If the message is...
27
3752
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 ported from VB3 to VB6, a job which took over two years. We would like to port it to Python, but we need to continue to offer upgrades and fixes to the...
22
2869
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 using Perl on the backend, with Javascript providing limited frontend functionality. As an example, an expanding tree would be fully populated on the...
0
7546
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7471
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7830
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5387
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5111
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3517
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1962
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1082
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
784
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.