[Cartoweb-users] Need to reset the session by PHP code

Oliver Christen oliver.christen at camptocamp.com
Mon Apr 26 07:43:28 EST 2010


Hi Jérémie

the simplest way is to add "?reset_session" (or "&reset_session" if you already have other parameters) in the url which allow the user to access the application.

otherwise, the reset_session parameter being used very very early in the whole workflow, you can not set it using the existing filtering mecanismes (im talking about the filterGetRequest/filterPostRequest) but what you could do is add some code in the client.php file, which is the default entry point for the application, or, if you used a redirector entry point (see "Project Shortcut" in http://www.cartoweb.org/cwiki/HowToCreateANewProject) you can add that code there instead.

$_REQUEST can be very easily manipulated, all you have to do is something like this:

$_REQUEST['reset_session'] = 1; 
(the assignated value has no real importance, it is not evaluated)
enclosed in some condition so you can set it or not depending of what you need, for example by checking the referer or something like that

regards
Oliver
  ----- Original Message ----- 
  From: JOALLAND jérémie 
  To: cartoweb-users at lists.maptools.org 
  Sent: Monday, April 26, 2010 2:13 PM
  Subject: [Cartoweb-users] Need to reset the session by PHP code


  I am using CartoWeb 3.5 in a CMS (Joomla), as I have several different cartographic menus.

   

  My problem is that my Cartoweb page is keeping the session information all the time.

  When the user is accessing one cartographic project for the first time, he can for example zoom in and change the layer visibility settings.

  Then he's accessing other parts of the web site.

   

  Problem : when he comes back to the same cartographic project for the second time, the cartoweb project page is not opened with default setting (initial extent, initial layers setting), but as it was after the first access : extent from zoom in and last layer visibility settings.

   

  Question : how can I reset the cartoweb session when opening my cartographic project page ?

  I am currently using this code to call the project (from php page in /htdocs/) : 

  <?php

  $_ENV['CW3_PROJECT'] = 'recherche_auvergne';

  require_once('client.php');

  ?>

   

  Thanks for you help.

   





------------------------------------------------------------------------------


  _______________________________________________
  Cartoweb-users mailing list
  Cartoweb-users at lists.maptools.org
  http://lists.maptools.org/mailman/listinfo/cartoweb-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/cartoweb-users/attachments/20100426/7b1b8aa7/attachment-0001.htm 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/jpeg
Size: 24273 bytes
Desc: not available
Url : http://lists.maptools.org/pipermail/cartoweb-users/attachments/20100426/7b1b8aa7/attachment-0001.jpeg 


More information about the Cartoweb-users mailing list