Select fails when cookie tried to get a numeric value

Denis McMahon denismfmcmahon at gmail.com
Sat Oct 5 19:36:14 EDT 2013


On Sat, 05 Oct 2013 16:38:14 +0300, Νίκος Αλεξόπουλος wrote:

> [my cookie code is fucked]

Hi Nick

I had never used python for www before yesterday. I had never used python 
before about 6 months ago.

In the last 24 hours I have installed mod-wsgi on my apache web server, 
and written test code that enables me to see the result of all 
environment data, parse the get string, parse post data, set and parse 
cookies, and save session data to a file specific to the cookie data.

There may be better ways to do some of it, but it works.

Here is a link to the text of my python file:

http://www.sined.co.uk/tmp/index.py.txt

Once you have read through it (there are comments) and understood how it 
handles cookies and session data, you will realise that you can add and 
modify any session data just by adding relevant items to and reading them 
from the session data dictionary. The session data stays on the server, 
the cookie simply identifies the session (and the session data file), and 
hopefully is unique to the user.

Don't ask me any questions about why I did something the way I did it. I 
did it that way because it works. If anyone knows a different way that 
also works and maybe works better, feel free to discuss it. But Nick, 
don't you dare suggest any change that doesn't work because you think it 
looks better.

If you don't understand a module function that I've used, read the python 
documentation for it.

If you think you have a question that is  not covered by the above 
statements, feel free to ask me, here, why I wrote a given line number or 
group of line numbers the way I did. However, see the notes above - the 
answer will probably be "because it works that way".

If you quote the whole file or even large chunks of it here, I am 
finished with trying to help you, ever!

-- 
Denis McMahon, denismfmcmahon at gmail.com



More information about the Python-list mailing list