Hello there, EE experts
According to the EE 2.4 user guide, the {ip_address} global variable is supposed to return the IP address of the currently logged in user. See http://ellislab.com/expressionengine/user-guide/templates/globals/single_variables.html#ip-address
Unfortunately, though, it’s not working for me. {ip_address} always returns 127.0.0.1, and other things like {exp:ip_to_nation:world_flags type="text"} don’t work correctly either. IP to Nation, for example, always says “Japan”, which is not correct.
Just for kicks, though, I changed the tag to {logged_in_ip_address} at the same place in one of my templates and it actually worked. Changing the variable that way also returns the correct IP address, and gets IP to Nation working.
So this, for example, doesn’t work:
{exp:ip_to_nation:world_flags type="text"}{ip_address}{/exp:ip_to_nation:world_flags}
But this does:
{exp:ip_to_nation:world_flags type="text"}{logged_in_ip_address}{/exp:ip_to_nation:world_flags}
That would be okay if all I needed was the world flags function, but I also need to use a different extension that depends on the user’s IP Address ... and that extension is not working as it should be. I assume the reason is that the standard {ip_address} variable is not being pulled in correctly.
By the way, when I turn on the Output Profiler I can see the correct value in the “ip address” item under “Session Data” and also in the “REMOTE_ADDR” item in the “HTTP Headers” section.
Any idea what might be going wrong, and how I can fix this?
Thanks in advance for any advice you may be able to give.
Cheers
Andrew