[mapguide-users] How to check if session is expired?
Martin Morrison
martin.morrison at edsi.com
Wed Nov 26 11:50:54 EST 2008
The cautionary statement that should accompany this is:
Users will leave a session up. This "could" on a heavily loaded site,
cause issues with the server running out of connections/resources.
I'm not saying that it is always a bad thing, you just need to be aware.
Martin
-----Original Message-----
From: mapguide-users-bounces at lists.osgeo.org
[mailto:mapguide-users-bounces at lists.osgeo.org] On Behalf Of gingerbbm
Sent: Wednesday, November 26, 2008 11:46 AM
To: mapguide-users at lists.osgeo.org
Subject: Re: [mapguide-users] How to check if session is expired?
FYI I have implemented the following "keep alive" functionality in
Fusion.
This JavaScript excerpt uses the PeriodicalExecuter() class from
Prototype.
Place it in your "Fusion initialised" function. It will do a getScale()
every 20 minutes and it appears to keep the map live all day :)
//
// Periodically poll the MapGuide server to keep the session
alive.
//
var map = Fusion.getMapById('Map');
new PeriodicalExecuter(
function(pe) {
console.log('Employing keep-alive measures [' +
new Date() + ']');
map.getScale();
},
1200 // period, in seconds
);
Hope this helps somebody...
Cheers
Stuart
--
View this message in context:
http://www.nabble.com/How-to-check-if-session-is-expired--tp6146014p2070
4615.html
Sent from the MapGuide Users mailing list archive at Nabble.com.
_______________________________________________
mapguide-users mailing list
mapguide-users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapguide-users
More information about the mapguide-users
mailing list