LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 05-29-2004, 05:27 PM   #1
The_Nerd
Member
 
Registered: Aug 2002
Distribution: Debian
Posts: 540

Rep: Reputation: 32
CGI Cookies


I need help with cookies. I am writing a forum, and I can't find any useful cookie tutorials on-line (all Perl) and I am not sure I even want to use cookies. You see, I want to know when a user enters or leaves the site, knowing when he enters isn't that hard, but how do I tell when he leaves??? I want this so I can say, %d users currently browsing this forum... and also for other resons. So basically, I want the cookie to store only the users name, and maybe one or two more values, then I want to somehow be notified when the user leaves the forum, or site. I am writing my forum in C, I know Python, and HTML (not very good at html though). I know nothing of Java-script, or any imbeded langauge like that. What do I do?

Please Help!!!
 
Old 05-30-2004, 09:07 AM   #2
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
It isn't very easy to determine the time that a user leaves the site. On most forums the correct label should be "users active over the last 5 minutes". For members that are logged in this is fairly easy to track and you could do it without cookies but for anonymous browsers you really need to use cookies or their IP. Both of these have drawbacks, such as some people disable cookies or you could have multiples users behind the one firewall that all identify from one IP address.

There are several ways to create cookies but since CGI.pm is probable the most popular here is a simple explanation:
http://perl.about.com/cs/intermediat...a/022504_p.htm
 
Old 05-31-2004, 11:00 AM   #3
The_Nerd
Member
 
Registered: Aug 2002
Distribution: Debian
Posts: 540

Original Poster
Rep: Reputation: 32
Thank you. I was already planning on a timeout. I was just hopping that if I could catch them leaving, then I could just log them off that way. Anyhow, I think my answer is:

<body onLoad="" onUnLoad="">

Thanks!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Perl CGI:Can't locate CGI.pm supermyself Programming 13 09-10-2007 06:22 AM
Where do cookies etc go? Bill Johns Linux - Security 3 04-11-2005 03:35 AM
C++ CGI scripts and Cookies The_Nerd Programming 3 11-10-2004 12:20 AM
CGI to work out side of cgi-bin? crashedspine Linux - Newbie 13 09-02-2004 08:49 PM
http://www.burstnet.com/cgi-bin/ads/ad7954a.cgi/3980/RETURN-CODE rverlander LQ Suggestions & Feedback 1 06-07-2002 07:35 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:05 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration