[mapguide-users] How to check if session is expired?
ruivilanova
rui.vilanova at gismedia.pt
Tue Nov 13 11:37:09 EST 2007
what about to use function GetScale() instead of Refresh() in setInterval?
Refresh can cancel user's navigation over the map.
Better than that would be to do a refresh (or a GetScale() ) only if the map
was inactive at more than 5minutes.
Kenneth, GEOGRAF A/S wrote:
>
> 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>
>>
>>
>
>
--
View this message in context: http://www.nabble.com/How-to-check-if-session-is-expired--tf2218864s16610.html#a13729604
Sent from the MapGuide Users mailing list archive at Nabble.com.
More information about the mapguide-users
mailing list