Shinyshell Community Forums > Coding > Problem with Python cookies in Chrome and Safari |
||||||
Sign Up | Member List | New Posts | Help |
[1]
May 29 02009, 12:58 GMT | ||||
Nick^ merciful justice Location: Brisbane, Australia Post count: 78 |
Now that I've started using the pre-alpha Chromium Mac as my usual browser, I've noticed something that really bugs me. Each time I quit the browser (this happens in Safari as well) my admin and chat cookies are both deleted; while Shinyshell's are not.
In Safari, when I looked at my cookie settings, Shinyshell's have an expiry date, while mine do not. In Firefox, however, both cookies work normally. Here's my cookie setting code in the administration log in: # Create a cookie expiration date 10 years from now What am I doing wrong? ______________________________ Lazurane |
May 29 02009, 17:34 GMT | ||||
Kthar Krme jedno bezglavo Location: kroatie Post count: 106 |
You're using Chromium Mac. Use Opera instead.
|
May 29 02009, 22:36 GMT | ||||
Nick^ merciful justice Location: Brisbane, Australia Post count: 78 |
No way. Opera's themes are horrible, and don't integrate with the Mac design at all. That is why I can't and don't use Opera. Plus, the widgets suck.
______________________________ Lazurane |
May 31 02009, 00:08 GMT | ||||
Peter* A Pythonic One Location: US Post count: 99 |
If I'm not mistaken, if you don't set an expiration date, they're deleted when you close the browser. I'm sure this isn't the answer. I just want to feel helpful. I also don't understand the code, sooo... I guess we can wait for Electron to show up.
|
May 31 02009, 01:58 GMT | ||||
Nick^ merciful justice Location: Brisbane, Australia Post count: 78 |
I am setting an expiry date, but Safari doesn't seem to recognise it.
______________________________ Lazurane |
May 31 02009, 02:20 GMT | ||||
Peter* A Pythonic One Location: US Post count: 99 |
That doesn't make sense; Python is interpreted server-side. O.o Sounds like a Safari problem...
|
May 31 02009, 17:03 GMT | ||||
lec** Supra stultitiam Location: Varaždin, Croatia Post count: 173 |
Sorry for the late post. It's not a Safari problem. I assume TIMENOW is declared in electron/include.py as
m.TIMENOW = time.time() In which case, the correct code is: # Create a cookie expiration date 10 years from now Because "electron.include.m.TIMENOW" is a nonexistent object, and Python was probably just regarding it as 0. And that would effectively set the expiration date to December 29th 1979. P.S. If you notice, the "m" object is actually __main__ (which is the namespace of the currently executing script). In effect, __main__.TIMESTAMP in the includes script (or m.TIMESTAMP in our case) just declares TIMESTAMP as a global value for easy use. |
May 31 02009, 21:12 GMT | ||||
Kthar Krme jedno bezglavo Location: kroatie Post count: 106 |
IS that Ribald the Barterman whose picture you've got in your avatar, Lec?
|
May 31 02009, 21:23 GMT | ||||
lec** Supra stultitiam Location: Varaždin, Croatia Post count: 173 |
Though do I not recall who that is, no. It is Eric Satie.
|
June 01 02009, 15:29 GMT | ||||
Kthar Krme jedno bezglavo Location: kroatie Post count: 106 |
Ribald the Baterman is an NPC from Baldur's Gate II: Shadows of Amn. It was actually a trick question to lure you into posting a reply so that I can reply again and thus increase my, already amazing, post count.
|
June 01 02009, 19:33 GMT | ||||
lec** Supra stultitiam Location: Varaždin, Croatia Post count: 173 |
You really tricked me this time. Of course, merely by posting this I'm again being tricked into letting you accumulate yet another post.
|
June 01 02009, 20:49 GMT | ||||
Kthar Krme jedno bezglavo Location: kroatie Post count: 106 |
Well, you knowest what they sayeth in Tennessee; actually, I don't know if it's in Tennessee, but I'm sure it's in Texas, so it's probably in Tennessee; fool me once, shame on you, fool me twice,.... youcan't get fooled again.
Are you ready?!?!?!?!?! Go! Out here in the fields I fight for my...rights to be fooled again. If anyone can guess the name of the band I'm aluding on here, IS! A! LAWNMOWER!!!!!!! P.S. Note the A! which is 375F00. |
June 02 02009, 20:16 GMT | ||||
Nick^ merciful justice Location: Brisbane, Australia Post count: 78 |
November 07 02009, 19:50 GMT | ||||
Peter* A Pythonic One Location: US Post count: 99 |
import Cookie, datetime, os |
November 08 02009, 03:38 GMT | ||||
Faltzer Member Location: Glendale, New York Post count: 38 |
I still don't get why everyone here always over-complicates what they want when there was obviously a good solution that actually works well is available.
______________________________ FHQ |
November 09 02009, 20:47 GMT | ||||
lec** Supra stultitiam Location: Varaždin, Croatia Post count: 173 |
Cookie ships with Python and is also a respectable Python module. I conclude it's not over-complicating.
|
[1]
Forum Information |
||||||||||
|