Working Python Cookies code.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • PiedmontBiz

    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.berkel ey.edu/~dyoo/python/cookiecounter.p y

    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=312342101233 24213133
    214013410313312 341012331231431 043210000112222 222222222333333 33333333344444
    444443333400030 249"

    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


Working...