hello,

I'am looking for a way / hook for indicate that authentificated user get the same cache than anonymous user.
I tried to play with the following parameter , but ...

$conf['authcache_key_generator'] = 'custom_cookiebasedkey';

Thanks in advance

Comments

chanac_hares created an issue. See original summary.

znerol’s picture

Sorry for the late answer. One very easy (and rather safe) trick is to just remove the session cookie on selected pages. If you only want to do that for selected users/roles, then just set a cookie during login (and remove it during logout).

Try something like this in settings.php (removes the session cookie for selected visitors accessing the front page):


define('TREAT_AS_ANON', 'anon');
define('SITE_SESSION_NAME', 'SESSabcdefg...');

if (!empty($_COOKIE[TREAT_AS_ANON]) && $_GET['q'] == '/' ) {
  unset($_COOKIE[SITE_SESSION_NAME]);
}

That would even work without authcache.

znerol’s picture

Status: Active » Fixed

Answered, reopen if necessary.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.