473,387 Members | 1,766 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

How to inplement Session in CGI

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:-)

Mar 28 '06 #1
5 5663
Sullivan WxPyQtKinter wrote:
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.

--
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in 'o****@xiludom.gro'.split('@')])"
Mar 28 '06 #2
>>>>> "Sullivan WxPyQtKinter" <su***********@gmail.com> (SW) wrote:
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/cg...=faq02.011.htp
or google for python cgi session for more.
But why write it yourself if someone else has already done the work?
--
Piet van Oostrum <pi**@cs.uu.nl>
URL: http://www.cs.uu.nl/~piet [PGP 8DAE142BE17999C4]
Private email: pi**@vanoostrum.org
Mar 28 '06 #3
Sullivan WxPyQtKinter wrote:
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...

Mar 28 '06 #4

bruno at modulix 写道:
Sullivan WxPyQtKinter wrote:
Python disappointly failed to provide a convinient cgi session
management module.


Probably because there are much better options for web programming in
Python ?

Really? Then what is it?

Mar 28 '06 #5
Sullivan WxPyQtKinter wrote:
bruno at modulix 写道:

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


Probably because there are much better options for web programming in
Python ?


Really? Then what is it?


Please notice the 's' at the end of 'options'. For a quick and
incomplete overview, you can start here:

http://wiki.python.org/moin/WebProgramming
--
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in 'o****@xiludom.gro'.split('@')])"
Mar 28 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Paul | last post by:
Hmmm, didn't seem to work. I have set session.use_cookies = 1 and session.use_trans_sid = 1 in my php.ini file. Index.php contains:...
27
by: mrbog | last post by:
Tell me if my assertion is wrong here: The only way to prevent session hijacking is to NEVER store authentication information (such as name/password) in the session. Well, to never authenticate...
2
by: Damien | last post by:
Hi to all, I'm currently re-designing our intranet : nice and lean CSS2, cleaned-up PHP 4.3.7, better-normalized MySQL ;o). So I've started using the $_SESSION variable instead of register_globals...
13
by: Mimi | last post by:
Hello, I am having trouble using the session vars in PHP 4.3.9 OS: Win XP Prof Web Server IIS (is local and there are no links to other servers from the web pages I work on) Browser: IE 6.0 ...
0
by: joseph conrad | last post by:
Hi, I tried to implement my own session handler in order to keep control on the process the drawback I foun it is not creating and storing in my cookie the PHPSESSID variable anymore. reading te...
14
by: aroraamit81 | last post by:
Hi, I am facing a trouble. I have some Session variables in my code and somehow my session variables are getting mixed up with other users. For example User A has access to 10 companies and...
7
by: aroraamit81 | last post by:
Well Guys, Here is a very strange trouble. When more than one users request tto same page at the same time then our session gets conflicted. Moreover I printed my SessionID, strangely but true I...
1
by: Santosh | last post by:
Dear All i am writting a code sending mail with attachement. i am writting code for sending mail in one page and code for attaching a file in the next page. aftet attaching a file i am taking...
5
by: lyealain | last post by:
<% If Session("username") = "" Then Response.Redirect("/CLS/Login.asp") End If Dim conn Dim connectstr Dim db_name, db_username, db_userpassword Dim db_server Dim res
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.