Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Flag allows anonymous flags using session_api. Very very good. This should mean session_api is fully and only responsible for storage. However, flag_flag::uses_anonymous_cookies()
uses a different approach to see whether to use FlagCookieStorage
(which sets a flags
cookie).
Before:
/**
* Returns TRUE if this flag requires anonymous user cookies.
*/
function uses_anonymous_cookies() {
global $user;
return $user->uid == 0 && variable_get('cache', 0);
}
Fixed:
/**
* Returns TRUE if this flag requires anonymous user cookies.
*/
function uses_anonymous_cookies() {
global $user;
return $user->uid == 0 && variable_get('cache', 0) && !module_exists('session_api');
}
If session_api is enabled, don't use a cookie.
Comment | File | Size | Author |
---|---|---|---|
#2 | flag-2884301-dont-use-session_api-AND-cookie.patch | 797 bytes | rudiedirkx |
|
Comments
Comment #2
rudiedirkx CreditAttribution: rudiedirkx as a volunteer commentedPatch against 3.9, but should apply to 3.x-dev.