Chameleon    Home  |  Docs  |  Support  |  Bugs  |  CVS  |  Downloads 

MapTools.org

Widget Magic

FAQ Questions

  1. How can I customize/change/enhance the Query widget?
  2. How does the KeepSessionAlive widget work and why should I use it?

FAQ Answers

Q: How can I customize/change/enhance the Query widget?

A: see QueryWidgetCustomizingResults

Q: How does the KeepSessionAlive widget work and why should I use it?

A: The KeepSessionAlive widget includes a 1x1 transparent pixel in the HTML of your application. The source of the image is a PHP script. This widget works by using javascript timers to reload the image source every X seconds (600 by default). By reloading the image source, the browser reloads the PHP script that draws the image. The PHP script also reloads the user's session, which updates the internal timestamp that PHP uses to determine if a session has expired (based on its timeout setting from php.ini - typically set to 30 mins). When the application is next 'used' by the user, PHP will see the session as being last accessed X seconds ago rather than the real amount of time that has passed, thus preventing PHP from considering the session as expired.

This is important because every PHP script that is run ... from any user and any page on the same server ... has a chance of triggering garbage collection, which is the process PHP uses to remove expired sessions from the server. Without the KeepSessionAlive? widget, if you leave an application open without doing anything to it for more than the timeout value set in php.ini, PHP will delete the associated session files and then when you do try to do something (after lunch) Chameleon will tell you that the session has expired.

Printer Friendly

 
 

Contact Information

Chameleon Users List