cookies cache
-
Hi,
I’m using this trick you told me about to exclude some cookies from cache$loggedInUser = “RewriteCond %{HTTP:Cookie} !^.*(comment_author_|wordpress_logged_in|wp-postpass_|wp_woocommerce_session|my_custom_curr|my_custom_curr_pos|my_custom_curr_symbol|my_custom_curr_coef|my_custom_curr_cur_post).*$”.”\n”;
This works just fine when i’m logged in.But when i’m not logged in the cookies remains in cache. I think this behavior happens after the latest wordpress update.
I’m trying to use a “testcookie” and cache on but with no luck
i have added
setcookie(“testcookie”, rand(),time()+3600,”/”); or
$_COOKIE[‘testcookie’]=rand();
in the ..add_action(‘after_setup_theme’, ‘wp_estate_init’);
if( !function_exists(‘wp_estate_init’) ):
function wp_estate_init() {
…….i also set my custom cookie in a function called via ajax.
and i do a
print_R($_COOKIE); in footer.phpin inc/admin.php i have added
if(isset($_POST[“wpFastestCacheLoggedInUser”]) && $_POST[“wpFastestCacheLoggedInUser”] == “on”){
$loggedInUser = “RewriteCond %{HTTP:Cookie} !^.*(comment_author_|wordpress_logged_in|wp-postpass_|wp_woocommerce_session|my_custom_curr|my_custom_curr_pos|my_custom_curr_symbol|my_custom_curr_coef|my_custom_curr_cur_post|testcookie).*$”.”\n”;
}When I’m logged in with admin the code works and values are changes for testcookie and other custom Cookies.
When I’m not logged in nothing changes for testcookie (or any other cookies set by me.)
The set cookies code works (otherwise it will not change value when i’m not looged in).
i don;t have any other cache plugin.
Can you help solve this ?
Thanks
- The topic ‘cookies cache’ is closed to new replies.