Community & Support

$_SESSION together with Normal Caching mode

On my page.tpl.php I make a call to a function in template.php.
This function sets a session value ($_SESSION['name'] = 'value';
Based on this value the output from page.tpl.php is different.

Now the problem:
If on admin/settings/performance the Caching mode is set to Normal, then for non authenticated users the call to the template function will not be made. Appearantly the whole page is cached.

Now the question:
How can I store (and retrieve) session information together with Normal Caching mode for anon users?

Thanks much!

Joep

Comments

A Module/JS/AJAX/AHAH

With caching a page is generated for anonymous users and then that html page is cached. If you want this page to be different based on a certain page based on a value you will need to alter it with JS, Ajax, or AHAH.

You can see an example of this in the comment_info module for drupal 5 or you can poke around the comment module in drupal 6 for the same functionality. Though, this does not happen via a session but instead a cookie.

--
Matt
www.mattfarina.com
www.innovatingtomorrow.net
www.geeksandgod.com
www.superaveragepodcast.com

Thanks mfer, You put me on

Thanks mfer,

You put me on the right track. I wrote a littel javascript to read and set the cookies.

-----------------------------------------
Joep
CompuBase, Drupal websites and design

-----------------------------------------
Joep
CompuBase, Dutch Drupal full service agency

nobody click here