Click here to get back home

Start an Event when a Session ends

 HomeNewsGroups | Search | About
 comp.lang.perl.modules    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Start an Event when a Session ends Santinho 12-20-2004
Posted by Santinho on December 20, 2004, 5:57 pm
Please log in for more thread options
--Signature=_Mon__20_Dec_2004_16_57_28_+0000_SUP9.his.A1NwLs1
Content-Type: text/plain; charset=US-ASCII
Content-Disposition: inline
Content-Transfer-Encoding: 7bit


Esteemed Perl Fellows,

Is it possible to start an event when a Session ends, using Apache, mod_cgi and
CGI::Session?

For example:

When a user enters one web page, I start one session and write a txt file. The
txt file's name is the user's session ID. So far so good.

If I have a button or a link to exit my site, and the user clicks it, I can
safely delete the txt file. But, if the user closes his/her browser's window?
The session is destroyed but I can't delete the file.

Any way to do this as easy as in ASP (remember the global.asa file) ?
Or any way at all?

Note: I don't have mod_perl nor Apache::ASP :(

Thanks for your time
Miguel

--Signature=_Mon__20_Dec_2004_16_57_28_+0000_SUP9.his.A1NwLs1
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)

iD8DBQFBxwSHrqcE5n6I30kRAqFuAKCBmE019D7Xt5AApgCR//+R1YG0LACfaHKQ
XntQ6mMZVe/ecWBzq55FQbY=
=XPmY
-----END PGP SIGNATURE-----

--Signature=_Mon__20_Dec_2004_16_57_28_+0000_SUP9.his.A1NwLs1--


Posted by Sherm Pendley on December 20, 2004, 2:52 pm
Please log in for more thread options
Santinho wrote:

> If I have a button or a link to exit my site, and the user clicks it,
> I can safely delete the txt file.

Only if *every* link away from your site goes through a CGI that cleans
up the session. Otherwise you won't even notice them leave.

> But, if the user closes his/her
> browser's window? The session is destroyed but I can't delete the file.

Right.

> Any way to do this as easy as in ASP (remember the global.asa file) ?

ASP can't do it either. ASP isn't magic, it's just scripting embedded in
a page - it can't tell any more than Perl can when a browser window closes.

> Or any way at all?

Easy: Just schedule a cron task that cleans up stale session files, and
does any other related housekeeping at the same time.

None of this is relevant to *any* c.l.perl.* news group, by the way. The
answer would be the same if you were using a Python script. Try
comp.infosystems.www.authoring.cgi next time.

sherm--

--
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org


Posted by Sherm Pendley on December 28, 2004, 4:41 am
Please log in for more thread options
pepper
celery
garlic
½ cup red wine
3 Irish potatoes
2 large carrots

This is a simple classic stew that makes natural gravy,
thus it does not have to be thickened.
Brown the meat quickly in very hot oil, remove and set aside.
Brown the onions, celery, pepper and garlic.
De-glaze with wine, return meat to the pan and season well.
Stew on low fire adding small amounts of water and
seasoning as necessary.
After at least half an hour, add the carrots and potatoes,
and simmer till root vegetables break with a fork.
Cook a fresh pot of long grained white rice.



Pre-mie Pot Pie

When working with prematurely delivered newborns (or chicken) use sherry;
red wine with beef (buy steak or roast, do not pre-boil).

Pie crust (see index)
Whole fresh pre-mie; eviscerated, head, hands and feet removed
Onions, bell pepper, celery
½ cup wine
Root vegetables of choice (turnips, carrots, potatoes, etc) cubed

Make a crust from scratch - or go shamefully to the frozen food section
of your favorite grocery and select 2 high quality pie crusts (you
will need one for the top also).
Boil the prepared delicacy until the meat starts to come off the bones.
Remove, de-bone and cube; continue to reduce the broth.
Brown the onions, peppers and celery.
Add the meat then season, continue browning.
De-glaze with sherry, add the reduced broth.
Finally, put in the root vegetables and simmer for 15 minutes.
Allow to cool slightly.
Place the pie pan in 375 degree oven for a few minutes so bottom crust is not
soggy,
reduce oven to 325.
Fill the pie with stew, place top crust and with a fork, seal the crusts
together
then poke holes in top.
Return to oven and bake for 30 minutes, or until pie crust is golden brown.



Sudden Infant Death Soup

SIDS: delicious in winter, comparable to old fashioned Beef and Vegetable Soup.
Its free, you can sell the crib, baby clothes, toys, stroller... and




Posted by Santinho on December 28, 2004, 7:35 am
Please log in for more thread options
-boned and cubed
¼ cup vegetable oil
2 large onions
bell pepper
celery
garlic
½ cup red wine
3 Irish potatoes
2 large carrots

This is a simple classic stew that makes natural gravy,
thus it does not have to be thickened.
Brown the meat quickly in very hot oil, remove and set aside.
Brown the onions, celery, pepper and garlic.
De-glaze with wine, return meat to the pan and season well.
Stew on low fire adding small amounts of water and
seasoning as necessary.
After at least half an hour, add the carrots and potatoes,
and simmer till root vegetables break with a fork.
Cook a fresh pot of long grained white rice.



Pre-mie Pot Pie

When working with prematurely delivered newborns (or chicken) use sherry;
red wine with beef (buy steak or roast, do not pre-boil).

Pie crust (see index)
Whole fresh pre-mie; eviscerated, head, hands and feet removed
Onions, bell pepper, celery
½ cup wine
Root vegetables of choice (turnips, carrots, potatoes, etc) cubed

Make a crust from scratch - or go shamefully to the frozen food section
of your favorite grocery and select 2 high quality pie crusts (you
will need one for the top also).
Boil the prepared delicacy until the meat starts to come off the bones.
Remove, de-bone and cube; continue to reduce the b




Similar ThreadsPosted
Expect: Getting PID at both ends of ssh January 22, 2007, 3:08 pm
Start server for test ? May 16, 2005, 12:52 pm
H Start your own business doing affiliate work. H$OU,lh_ January 2, 2005, 12:41 am
Win32::Service Determining which are set to start automatically July 12, 2004, 10:14 am
HTTP::Proxy - how to detect start and end of URL fetch September 26, 2004, 6:00 am
Start printing at the end of the previous line in Perl July 18, 2006, 10:51 am
hiding Win32::SerialPort->start( ... ) error messages April 19, 2005, 2:27 am
Event-1.03 module March 2, 2005, 4:19 pm
ANNOUNCE: POE-Event-Message May 11, 2007, 12:41 pm
Can't locate loadable object for module Tk::Event July 15, 2005, 9:15 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap