Hi,

I'm using this module to allow users to customize a selection of div elements. It works great with Drupal's page caching turned off. However, when the page caching is on, it fails. I have it set to function via cookie method. I'm also using Flag, which uses Session API. I noticed that when someone flags something, then returns to the page with custom ordering, it works. It seems like it needs Drupal's SESS id. Just using it on it's own, there is no SESS id set, just the Drupal.session.binname. Could you provide any insight?

Thanks!!

Comments

rdeboer’s picture

Hi cbrasfield,
Thank you for your interest in Session Cache API.

I think I'm going to need a bit more information before I can fully understand what's going on on your system.

First of all, when you say "page caching", do you mean the tickbox Cache pages for anonymous user on the admin/config/development/performance page?

And what exactly fails? The storage of the Session Cache API session data or the retrieval?

You are of course aware that Session Cache API is an API. It does nothing if its two functions aren't called by other modules or code you write yourself.
The only modules I know at this stage that call the Session Cache API are: Smart IP, Views Global Filter and IP Geolocation Views and Maps.
Flag does not call Session Cache API and neither does core, of course.

Frankly I can't see how Session Cache API interferes with any other caching system, including Session API as used by the Flag module, because Session Cache API stores its user session data in a different spot and under different keys than core or any other module.

What $bin id's are you passing to the Session Cache API calls:

 session_cache_set($bin, $data);

and

  $data = session_cache_get($bin);

Rik

cbrasfield’s picture

Hi Rik,

Thanks for your quick response.

Yes, I am referring to the Cache pages for anon users box on the Performance page.

It is the retrieval piece fails. It wasn't interfering with any session_api; I just noticed that the retrieval didn't work with caching on unless there was a session set. Upon forcing a Drupal session, everything once again works as it should; without it, it fails.

As it's still in a test phase, the $bin ids are simply 'testingone', etc.

I'll see if I can stand up a new install with only the above parameters and see how it's affected.

Thanks again for your response.

rdeboer’s picture

Hi cbrasfield,
Yes a reproduceable test-case would be great, as right now I'm stumped.
Rik

cbrasfield’s picture

Status: Active » Fixed

Hello Rik,

This was not an issue having to do with your module. :) While I cannot for the life of me find the link at the moment, I discovered that the root cause for analysis was Drupal disabling caching when PHP sessions are invoked for anon users. It was session_api that had an issue and was fixed with this patch: http://drupal.org/files/session_api_nophpsession.patch. My end result was to use JS to do the initial load of items rather than Drupal and after an hour or so, realizing I needed ajax cache false in my callback to session cache. It works now. Yay!

Thank you so much for your assistance.
Christina

edit: Apologies for the delayed response.

rdeboer’s picture

Status: Fixed » Closed (works as designed)

Ok, all good, Christina.
Closing.
Rik