[mapguide-users] How to check if session is expired?
Kenneth, GEOGRAF A/S
ks at geograf.dk
Tue Sep 5 02:48:56 EDT 2006
I don't think so, because the map's current layout, zoom, properties,
etc ..., is stored in the session, so creating a new session, would
reset all those properties, giving the initial map.
What you can do, is run a javascript timer that polls a page, that
performs a keep-alive of the session, as long a the browser is open.
A simple way, to achieve this is to call Map.refresh every 5 minutes:
window.setInterval('document.GetMapFrame().Refresh();', 50000);
This approach might refresh the map at times when it is not wanted (but
should be harmless).
A more sophisticated way would be through an AJAX call that performs the
session access (and thus refresh) on the server.
Also, I believe there is a way to set the session length, so that you
may increase it.
Kenneth, GEOGRAF A/S
Jackie Ng skrev:
> Hi all,
>
> Is there a way to check if a given MapGuide session ID has expired or
> not? I am experiencing this annoying problem of the mapguide session
> expiring after about 10 mins, forcing me to do a manual refresh of the
> browser. Can I do something like this?
>
> string sessionId = Request.QueryString["sessionID"];
> if( sessionId is no longer valid)
> {
> sessionId = CreateSession();
> ...
> }
>
> Regards,
>
> Jackie Ng
>
> AEC Spatial Pty Ltd. / AEC Systems Pty Ltd.
> SYDNEY - MELBOURNE - BRISBANE - PERTH - ADELAIDE - HOBART
>
> A.B.N: 32 075 809 451
>
> Level 4, 37-41 Prospect St. Box Hill, Victoria, 3128
>
> Phone: 1300 368 609
> Fax: 1300 362 140
>
> www.aecsystems.com.au
> jackie.ng at aecsystems.com.au <mailto:jackie.ng at aecsystems.com.au>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapguide-users/attachments/20060905/c4787f01/attachment.html
More information about the Mapguide-users
mailing list