473,796 Members | 2,495 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Tracking Sessions in a Python CGI app.

Is there a unique session ID created in a Python CGI app.?

If not, and I suspect not, what is the best way to keep track of the session
that loads each web page? I need to store form data from multiple forms
completed by the user. What is the best way to keep track of which user is
which?

Thanks!
Jul 18 '05 #1
2 2545
"Andrew Chalk" <ac****@XXXmagn acartasoftware. com> wrote:

Is there a unique session ID created in a Python CGI app.?
No. Each transaction in a web server is separate. There is no concept of
"sessions".
If not, and I suspect not, what is the best way to keep track of the session
that loads each web page? I need to store form data from multiple forms
completed by the user. What is the best way to keep track of which user is
which?


One common way is to generate a random number as a session ID and send it
to the client as a cookie. Another way is to embed the session ID in a
<input type=hidden> field, but then you have to remember to carry that
forward in ALL the forms.
--
- Tim Roberts, ti**@probo.com
Providenza & Boekelheide, Inc.
Jul 18 '05 #2
Many thanks!
"Tim Roberts" <ti**@probo.com > wrote in message
news:61******** *************** *********@4ax.c om...
"Andrew Chalk" <ac****@XXXmagn acartasoftware. com> wrote:

Is there a unique session ID created in a Python CGI app.?


No. Each transaction in a web server is separate. There is no concept of
"sessions".
If not, and I suspect not, what is the best way to keep track of the sessionthat loads each web page? I need to store form data from multiple forms
completed by the user. What is the best way to keep track of which user iswhich?


One common way is to generate a random number as a session ID and send it
to the client as a cookie. Another way is to embed the session ID in a
<input type=hidden> field, but then you have to remember to carry that
forward in ALL the forms.
--
- Tim Roberts, ti**@probo.com
Providenza & Boekelheide, Inc.

Jul 18 '05 #3

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

Similar topics

3
2439
by: Shanfeng Cheng | last post by:
I write a piece of code to tracking the number of clicks on a link each day. The link usu. gets about 3000-6000 clicks per day. I just store today's click count in a one-line text file, like, 01/07/2004 1234 The first field is the date and the second field is number of clicks. I just read the current count, increase by 1 and then write back. When another day comes, I write today's count to mysql DB.
1
1936
by: AJ | last post by:
Hi all I've just written a VERY simple shopping cart system for my own joy and edification as much as anything else. Mostly it was an exercise in learning about sessions but I want to keep adding to it. What happens at the moment is that it starts a session when the visitor enters the site. As soon as the visitor adds something to their cart it adds a row into a table where the session id is used as the unique identifier in the...
2
2618
by: marslee | last post by:
I want to prevent non-registered users to view a page in my website, For example, when a non-registered user clicks the history page, the website site refuses to go there since he is not registered. what is the best way to do it? And how to identify a user has already logged in when he click the history page?
6
2042
by: Tran Tuan Anh | last post by:
Hi all, I am new to Python and desperated to look for a good Python debugger. I mean a debugger with source coding tracking. For C/C++, emacs and gud offers execellent development env. The source code tracking is extremely useful for recursive functions. I have spent time Googling but not found anything near. Thanks!
2
5475
by: David Frauzel | last post by:
I'm writing a rough draft of a suite of small Perl apps that will, combined, serve as a web site's user sign-up, login, management, and customized content engine. I'm having trouble with the concept of one particular part of the "application" (as it were) - session tracking. Perl itself is handling user authentication (since I've no idea how Perl could "ask" the server who just authenticated to htaccess), so the login script will have an...
0
1043
by: Ben Fidge | last post by:
Dear All I've got a javascript occuring on a live site but cannot recreate it using my version of IE 6!! And therefore cannot debug it! Our site is http://cobas.co.uk The error I'm getting is: Message: Object expected
2
11180
by: runner7 | last post by:
Can anyone tell me if there is a way in PHP to determine when a session times out on the server or how many concurrent sessions there are in your application?
4
1642
by: moogyd | last post by:
Hi, (Off-topic) I am looking to put an open-source bug/issue tracking system in place for our current project (eventually expanded for all projects), and would appreciate any experiences/comments/suggestions. Note the project is encompasses embedded hardware (ASIC plus firmware) plus application software.
10
1515
junior29
by: junior29 | last post by:
Hi, I just wondered if anyone could help me at all. I'm doing a piece of coursework building a social network (which is getting there!), we are supposed to add an administration element to include tracking of access of pages by registered users to include their username, date and time of access, browser used, ip address of user and which page was accessed. This is to be put into a report to then be able to be sorted by page, user and by...
0
9529
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10457
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10231
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9054
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7550
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5443
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5576
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3733
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2927
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.