#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2002
    Posts
    3
    Rep Power
    0

    Generating cookie


    I'm having trouble creating a cookie, using Python's Cookie module.

    Here is my code:
    Code:
    import Cookie
    cookie=Cookie.Cookie()
    cookie["name"]="Python"
    cookie["name"]["expires"]=3600
    cookie["name"]["version"]=1
    print cookie
    Now when I got to my cookie folder I dont see the cookie I just created. Does cookies in Python must be created within a
    Python-CGI script???
    Last edited by Blaktyger; December 7th, 2002 at 05:45 PM.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2002
    Posts
    89
    Rep Power
    13
    hello, I'm not familiar with the cookie module at all but try changing your

    cookie = Cookie.Cookie()

    to

    cookie = Cookie.SimpleCookie()

    I know this is wrong but like I said I don't know anything about the Cookie module and you might want to give that a shot.
    Last edited by jimmy2k1; December 7th, 2002 at 08:33 PM.

IMN logo majestic logo threadwatch logo seochat tools logo