[support] Session variable and cache

Bert Van Kets mailing at vankets.com
Wed Apr 18 08:25:48 UTC 2012


Gordon,

it does look like the Splash module could do what I need if I were using 
D6. :-/

In the mean time I set the cache lifetime to 1 minute. As this is a 
super small site with hardly any visitors (it's a SOHO company web 
presence type of site) caching is hardly necessary.

Bert

On 18/04/2012 10:17, Gordon Heydon wrote:
> 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