XF 2.1 Session issues with admin panel and avatar

Dakis

Well-known member
I have a couple of problems that seem to have to do with sessions or cookies or something: in my admin panel it keeps logging me out after a couple of pages, and also trying to change your avatar it throws an error: "Oops! We ran into some problems. Cookies are required to use this site. You must accept them to continue using the site."

I am running php 7.3.12 and nginx 1.17.6.

I have cookie prefix, path and domain defined in my config.php, what else can I do to figure this out?

I have no rules on CloudFlare, and I also tried to disable cache for the admin panel there, which didn't work either.

Any ideas?
 
Your IP address is most likely changing sporadically.

This could indicate we aren’t seeing your real IP address but instead seeing CloudFlare’s IP address. We do take measures to circumvent that, though.

There’s a chance it might not be CF. If you have something like Google Data Saver or use a certain browser that proxies traffic then that could also be the cause.

First step is to ascertain what XF is seeing your IP address as. You can see your IP address on the members online list on your forum. Make a note of it and a DNS look up may confirm it’s actually a CF IP address. If you refresh that page a few times, I suspect you will see it change after a few requests.
 
Thanks for taking the time to reply Chris. I have tried this from different locations, one of them has a static IP which doesn't change, and the other one has dynamic IP, I get the same behaviour in both situations.

Looking at what XF is seeing, I see my own actual IP every single time, so no changes at all. And this is the same in all three forums this is happening.

Is there something else I could try?
 
Do you employ any sort of caching on the server and configured in config.php? Such as memcached or Redis?

If you have a line like this in your config:
PHP:
$config['cache']['sessions'] = true;

You may want to try setting this to false to see if it changes things.
 
Yes I did think about that and had a look, no I don't have anything on any of the 3 forums.

I had before, while still on xf1.5 but I assume that doesn't matter any more.

Should I check if any caching is configured on the server still, even if there's no entries in my config files?
 
If you have no caching configured then, no.

In that case then really it can only be related to the cookie configuration you mentioned before.

Is it possible that the 3 forums are all using the exact same cookie configuration and therefore are overwriting each other?
 
They have their own domain and path set, but same prefix I believe, but I assume that is not an issue since they have different domains.

I actually think I removed the cookie definition for one of them yesterday to test it without this with no results.

Hmmmm.....
 
How about this strange find:

  • when I log on to my admincp and go to the admin log, I see my correct true IP there
  • when I go to the /online/ url on my forum I see my correct true IP there
  • however when I click on my username and go to "ip addresses" I see IPs from all over the place

So the first two suggest there's no issues with IPs, but the third part suggests there is.

Is that a fair assumption? And why would there be a difference to what you can see in the admin panel admin log, the online members page, and the ip addresses popup for a member?
 
@Chris D it turns out it was in fact the IPs being all over the place for some reason. Once I identified this was the issue I managed to fix it.

Many thanks for pointing me to the right direction. :)
 
Back
Top Bottom