Working Python Cookies code.

P

PiedmontBiz

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/gq.py?QuestionNum=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
21401341031331234101233123143104321000011222222222222233333333333333344444
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,183
Messages
2,570,967
Members
47,520
Latest member
KrisMacono

Latest Threads

Top