[mapguide-users] How to check if session is expired?
François Van Der Biest
francois.van-der-biest at onf.fr
Thu Sep 28 05:22:00 EDT 2006
Jackie Ng a écrit :
>
> Hi François
>
> Thanks for the suggestion, I have since found out an easier way, to check
> the length of MgSite.GetCurrentSession() as it will return an empty string
> if expired.
>
Strange thing : the result of MgSite.GetCurrentSession() is always empty
in my case (MGE 2007).
Has anyone ever experienced this ?
> But now when I try to access my map with this newly generated session id. I
> get "Resource not found" errors. I thought that session resources would be
> automatically created with the new session as stated in the API docs. (???)
>
We now share the same concern about this point.
Moreover, I 'd like to know if one always has to create a new session
each time the application is started (by the same person on the same
machine), or if one could re-use pre-existing session.
For instance, I'd like to do something like this, at application startup :
$userinfo=new MgUserInformation("Anonymous","");
$site=new MgSite();
$site->Open($userinfo);
if (strlen($site->GetCurrentSession())==0)
$_SESSION['mgSessionId'] = $site->CreateSession();
else
$_SESSION['mgSessionId'] = $site->GetCurrentSession();
... but the fact that GetCurrentSession always returns an empty string
prevents me from trying such a thing.
> I ask this question because I have actually tried bumping up the session
> expiry time in the MapGuide Site admin, and it didn't seem to make any
> difference :(
Same problem. Did you get any solution in the mean time ?
I'm beginning to be fed up with this problem...
F.
More information about the Mapguide-users
mailing list