[support] Session variable and cache

Gordon Heydon gordon at heydon.com.au
Wed Apr 18 08:17:23 UTC 2012


Hi,

Take a look at the splash module http://drupal.org/project/splash it may provide a solution for you.

Gordon.

On 18/04/2012, at 5:53 PM, Bert Van Kets wrote:

> Hi all,
> 
> I have a D7 website that needs to show an animation when the user enters 
> the site, but not for as long as the user stays on the site.
> I wanted to use a session variable for this, but it seems there are many 
> times the animation is not triggered. I assume this is due to caching of 
> the page. How can I overcome this? Is there a cache save session 
> variable or an alternative method used in situations like mine.
> 
> At the start of the animation part I have the code
> <?php
> if(! isset($_SESSION['showAnimation'])):
> ?>
> 
> at the end of the part I have
> <?php
> endif;
> $_SESSION['showAnimation']=2;
> ?>
> 
> So when the user first visits the site, the variable is not found and 
> the animation is show. After the animation the session variable is set 
> and the animation is not shown any more. That last version is cached and 
> the animation is not shown, even for the next user who visits the site.
> 
> Thanks for any help.
> 
> Bert
> 
> 
> -- 
> [ Drupal support list | http://lists.drupal.org/ ]



More information about the support mailing list