Client IP addresses randomly changing from IPv6 to IPv4

Hello,

I am currently experiencing a problem where client IP addresses keeps changing from IPv6 to IPv4. My web server is correctly configured to get the real IP from clients.
Clients that connects to my website, during their navigation, will randomly have their IP address changed from IPv6 to IPv4 and vice-versa, which causes them to get disconnected from their sessions as a security measure, which is annoying for my users.
Is this possibly a configuration issue? If so, what configuration do I have to change to keep their IP addresses from changing?

1 Like

Bump, I also have this issue and need help :frowning:

If the IP of the visitor, that you can read from the headers, changes there is nothing you can do to change the behavior. That is decided by the user’s browsers. Cloudflare controls only what happens after the traffic hits them, and this step won’t change what the original IP is.

I do not have any experience with PHP but from what I can tell, the web application I am using does not get the IP from any headers, but instead from the request itself. To be specific, I am using the forum software “phpBB” and the following is the line of code responsible for registering the client’s IP address.

$ip = htmlspecialchars_decode($request->server('REMOTE_ADDR'), ENT_COMPAT);

I am using nginx with set_real_ip_from and real_ip_header CF-Connecting-IP; to get the client’s real IP. The IP list of Cloudflare servers are up to date for both IPv4 and IPv6.

This, even though I’m not very fluent with nginx, sounds the correct part. It’s the CF-Connecting-IP header which hosts the original visitor IP.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.