Closed (won't fix)
Project:
Google Analytics Email (Contact Form, Webform, Rules)
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Reporter:
Created:
12 Jan 2011 at 17:10 UTC
Updated:
1 Jan 2014 at 16:04 UTC
Jump to comment: Most recent
Comments
Comment #1
Brian294 commentedThank you for reporting this issue.
I have limited understanding of Varnish, but it's my understanding that it's a reverse proxy. It is intercepting page requests and servicing them from cache. This mechanism completely bypasses the execution of PHP/Drupal code, therefore causing the tokens to not be created. I am not an expert in Varnish, but I would recommend you look at the possibility of adding URL exceptions to the reverse proxy (such as the URL of the form and form processing script).
Peace,
Brian
Comment #2
vacilando commentedI am using Pressflow with Varnish and it is easy to get the correct IP address simply by using ip_address() instead of $_SERVER['REMOTE_ADDR']. See http://api.drupal.org/api/drupal/includes--bootstrap.inc/function/ip_add...
Comment #3
vacilando commentedI think it should be possible despite the use of Varnish; see #2.
Comment #4
Brian294 commentedVarnish only returns static HTML and doesn't execute the PHP on each page load. How can this work without the PHP executing? The PHP code is where all of the cookie logic resides.
Comment #5
greggles@Brian294 - I think you're right that you need to set Varnish not to cache these pages AND use ip_address in order to get the real IP address.
Basically it's never appropriate to use $_SERVER['REMOTE_ADDR'] directly and Drupal modules should always call ip_address().
Comment #6
Brian294 commented