How to inplement Session in CGI

  • Thread starter Sullivan WxPyQtKinter
  • Start date
S

Sullivan WxPyQtKinter

Python disappointly failed to provide a convinient cgi session
management module. Not willing to use external modules, I would like to
implement a simplest Session object on my own.

The basic problem is: how could a python CGI program understand several
requests are in the same session? Definately, request from different IP
would be easy to identified to be in different sessions, but request
from the same IP would not.

Anyone has any idea?
Thank you:)
 
B

bruno at modulix

Sullivan said:
Python disappointly failed to provide a convinient cgi session
management module.

Probably because there are much better options for web programming in
Python ?
Not willing to use external modules, I would like to
implement a simplest Session object on my own.

The basic problem is: how could a python CGI program understand several
requests are in the same session?

Just like anyone else: by setting a session cookie. This is not related
to CGI, it's just how HTTP works.
 
P

Piet van Oostrum

Sullivan WxPyQtKinter said:
SW> Python disappointly failed to provide a convinient cgi session
SW> management module. Not willing to use external modules, I would like to
SW> implement a simplest Session object on my own.
SW> The basic problem is: how could a python CGI program understand several
SW> requests are in the same session? Definately, request from different IP
SW> would be easy to identified to be in different sessions, but request
SW> from the same IP would not.

http://starship.python.net/~davem/cgifaq/faqw.cgi?req=show&file=faq02.011.htp
or google for python cgi session for more.
But why write it yourself if someone else has already done the work?
 
P

Peter Hansen

Sullivan said:
Python disappointly failed to provide a convinient cgi session
management module. Not willing to use external modules, I would like to
implement a simplest Session object on my own.

The basic problem is: how could a python CGI program understand several
requests are in the same session? Definately, request from different IP
would be easy to identified to be in different sessions, but request
from the same IP would not.

Anyone has any idea?

Maybe you could get over your irrational fear of external modules just
long enough to download one or two and examine them, to learn how they
do it. Then you could answer your own question...
 
S

Sullivan WxPyQtKinter

bruno at modulix 写é“:
Probably because there are much better options for web programming in
Python ?
Really? Then what is it?
 

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

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top