473,397 Members | 2,033 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,397 software developers and data experts.

Working Python Cookies code.

Greetings

I am working on web site (class project) which has a personality assessment
survey section. I originally wrote a standalone program in RapidQ basic. I
decided to rewrite the program for the web using python. I use Javascript on
the client side and two python scripts on the back side.

Problem. It would have been very easy (I think) if I could have gotten my
python script to read and write cookies . I am a newbie to python. I am not
able to make any of the code snippets work. I have tried.

the examples in the python23 documentation (cute code but useless to me)
ug's Python CGI scripts: cookie.py (compiler balks, throws exceptions)
Danny Yoo's script hkn.eecs.berkeley.edu/~dyoo/python/cookiecounter.py

I finally got it to work by just using javascript to call the script and pass
the form
eg. ( http://www.expectedend.com/cgi-bin/g...uestionNum=123)

this works, but the final screen of the program -- 110 python-generated pages
total-- contains a key value 110 characters long.

example session:
"http://www.expectedend.com/cgi-bin/testresults.py?SG=31234210123324213133
21401341031331234101233123143104321000011222222222 222233333333333333344444
444443333400030249"

I suppose a user might be concerned to see this large url in his/her address
window.

Does anyone have a working cookie snippet which would only use standard Python
2.3+ libraries and not require anychanges to Apache or any binary dependencies?

Or, is my solution good enough.

Thanks in advance.
Allen
Jul 18 '05 #1
0 1304

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

Similar topics

2
by: David McNab | last post by:
Hi, I'm looking for adventurous pre-alpha testers for a DHTML (active website) framework for Python I've developed. Name: - pyWeb Features:
2
by: mir nazim | last post by:
i m currently using PHP with Apache (a.k.a 'mod_php') for my web development work. i came to know that python can also be used to do web programming using 'mod_python' for Apache. i wanted to know...
8
by: Pete..... | last post by:
Hi all I am working on a log in script for my webpage. I have the username and the password stored in a PostgreSQL database. The first I do is I make a html form, where the user can type in his...
5
by: Jeff Johnson | last post by:
I'm using forms authentication to protect a subfolder within my site. I've got it working fine except for two issues: (1) When I do a RedirectFromLogin page I have to put a cookie path ("/"...
8
by: Brad Simon | last post by:
I have written a shopping cart using ASP .NET (VB). It has been running quite successfully on a site for about a year or so. I use the SessionID as the key to hold information on the shopping...
0
by: Matthias Steinbart via .NET 247 | last post by:
Ok, I spend now half the night to get this working. And actuallyit works, the only problem is, my user can't sign out anymore. Here is what I'm doing: I've got a web-app which has...
5
by: Martin Heuckeroth | last post by:
Hi We are working on a webservice application and are having some problems with the cookies and/or sessions. We have them working on our intranet but then its not working on the internet. We...
3
by: Raghu Raman | last post by:
Hi, I want to store a cookie peemanently for 2 days.From msdn article, i have coded like this.It is working when i run my application .But if i close my browser and restart my application , i...
6
by: test | last post by:
Hi everyone, I'm creating a desktop Python application that requires web-based authentication for accessing additional application features. HTTP GET is really simple. HTTP POST is not (at...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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?
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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,...
0
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...

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.