<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7226.0">
<TITLE>RE: [Chameleon] Sessions and jsapi</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->
<P><FONT SIZE=2>Liz,<BR>
<BR>
I think I have had similar problems, now that I think of it. I never looked into it, because the "session expired" on first load only happens sometimes, probably 1% of cases :) I thought it was just a freak unsolvable bug.<BR>
But only on our internal server through the intranet. To get to our external server, we have to go through a firewall and proxy server, slowing it down sufficiently to probably not make it happen.<BR>
<BR>
Thanks for the fix, I will try it out on Monday.<BR>
<BR>
regards,<BR>
<BR>
Jacob<BR>
<BR>
<BR>
<BR>
<BR>
-----Original Message-----<BR>
From: chameleon-bounces@lists.maptools.org on behalf of Liz Godwin<BR>
Sent: Sat 4/29/2006 5:17 AM<BR>
To: chameleon@lists.maptools.org<BR>
Subject: [Chameleon] Sessions and jsapi<BR>
<BR>
Hello fellow users,<BR>
<BR>
I have a question about something I havn't seen anyone post about yet...<BR>
<BR>
I have a really fast chameleon application (IMHO). Sometimes when it runs,<BR>
the session will timeout when you first call it. So obviously the 24<BR>
minutes (or however long it is) hasn't passed to expire the session<BR>
normally.<BR>
<BR>
The reason I bring up speed, is I'm wondering if it's happening because it's<BR>
in JSAPI mode and making concurrent calls to the server. One of them is<BR>
called before the session exists and fails. Is this possible??? So far<BR>
I've been hard pressed to duplicate this on my development server, but it's<BR>
happening on the production one. go figure! The production server is<BR>
faster than the development one.<BR>
<BR>
When I wrote the code, I extended the JSAPI widget to include a JS function<BR>
that redirects the client to a restart page containing a link to the<BR>
application. This function is called in UpdateMap.php like this...<BR>
<BR>
if (!initializeSession("sid")){<BR>
$szFormContents = "<input type=\"hidden\" name=\"SESSION_EXPIRED\"<BR>
value=\"true\" />\n";<BR>
$szOnLoad = 'NLWISSessionExpired()';<BR>
echo BuildHTMLOutput( $szOnLoad, $szFormContents, 0 );<BR>
return;<BR>
}<BR>
<BR>
such that if any call is made back to the server the app will redirect when<BR>
the session has expired. I added this because in jsapi mode, the<BR>
sessionexpired widget doesn't work. I also added code in session.inc.php to<BR>
check for an expired session and if it has to do similar redirection. All<BR>
of this works beautifuly on the dev server, at least if it's happened i<BR>
don't remember when and cannot duplicate it. On the production one (and<BR>
test server too), it fails 1% (ish) of the time.<BR>
<BR>
To see the application live, check out the following:<BR>
<A HREF="http://nlwis-snite1.agr.gc.ca/eco/">http://nlwis-snite1.agr.gc.ca/eco/</A> or <A HREF="http://nlwis-snite1.agr.gc.ca/plant00/">http://nlwis-snite1.agr.gc.ca/plant00/</A><BR>
<BR>
PLEASE - if it fails abnormally for you, please send me an e-mail with the<BR>
time (with time zone) you used it, and the application you were on.<BR>
<BR>
Cheers,<BR>
<BR>
Liz<BR>
<BR>
</FONT>
</P>
</BODY>
</HTML>