Redirect to Login when using mobile data

InvoicePlane: 1.5.11
PHP: 7.4.33
Apache: 2.4.58

I have been using InvoicePlane for around 18 months without issue. I have recently moved workshop where I have no wifi/lan and am using my phone’s 4G network connection.

While using mobile data, I regularly get redirected to the login page. I cannot reproduce this behavior when using the same phone and browser(s) when connected to wifi. And have never had it occur when using a computer connected to a LAN - wired or wifi. I am reasonably satisfied that it only occurs when using mobile data from the phone.

I have enabled InvoicePlane debugging, and don’t see anything of interest in the resulting log.

The following 2 Apache log excerpts are from sessions from the same phone. The sequence of events is:

1: Login
2: View QU015 from the dashboard.
3: Select Dashboard from the Menu.

at this point:

In the first log - mobile data - I am presented with the login page.

In the second log - wifi - I am presented with the Dashboard.

Mobile data:

58.178.130.178 - - [28/Nov/2023:13:33:03 -0700] "GET /InvoicePlane/index.php/dashboard HTTP/1.1" 307 - "http://rnsplasma.com/InvoicePlane/index.php/dashboard" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.0 Safari/605.1.15" 557 **0/557142**
58.178.130.178 - - [28/Nov/2023:13:33:04 -0700] "GET /InvoicePlane/index.php/sessions/login HTTP/1.1" 200 876 "http://rnsplasma.com/InvoicePlane/index.php/dashboard" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.0 Safari/605.1.15" 17 **0/17174**
58.178.130.178 - - [28/Nov/2023:13:33:07 -0700] "POST /InvoicePlane/index.php/sessions/login HTTP/1.1" 303 - "http://rnsplasma.com/InvoicePlane/index.php/sessions/login" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.0 Safari/605.1.15" 114 **0/114260**
58.178.130.178 - - [28/Nov/2023:13:33:07 -0700] "GET /InvoicePlane/index.php/dashboard HTTP/1.1" 200 4727 "http://rnsplasma.com/InvoicePlane/index.php/sessions/login" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.0 Safari/605.1.15" 37 **0/37371**
58.178.144.85 - - [28/Nov/2023:13:33:15 -0700] "GET /InvoicePlane/index.php/quotes/view/15 HTTP/1.1" 200 9441 "http://rnsplasma.com/InvoicePlane/index.php/dashboard" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.0 Safari/605.1.15" 29 **0/29988**
58.178.144.85 - - [28/Nov/2023:13:33:15 -0700] "GET /InvoicePlane/index.php/upload/upload_file/23/uRBvqhsUakoXdpA1FfKDE5cJYTG2rP3S HTTP/1.1" 200 22 "http://rnsplasma.com/InvoicePlane/index.php/quotes/view/15" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.0 Safari/605.1.15" 13 **0/13560**
58.178.130.178 - - [28/Nov/2023:13:33:19 -0700] "GET /InvoicePlane/index.php/dashboard HTTP/1.1" 307 - "http://rnsplasma.com/InvoicePlane/index.php/quotes/view/15" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.0 Safari/605.1.15" 12 **0/12099**
58.178.130.178 - - [28/Nov/2023:13:33:19 -0700] "GET /InvoicePlane/index.php/sessions/login HTTP/1.1" 200 873 "http://rnsplasma.com/InvoicePlane/index.php/quotes/view/15" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.0 Safari/605.1.15" 13 **0/13603**

Wifi:

58.178.130.178 - - [28/Nov/2023:13:33:03 -0700] "GET /InvoicePlane/index.php/dashboard HTTP/1.1" 307 - "http://rnsplasma.com/InvoicePlane/index.php/dashboard" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.0 Safari/605.1.15" 557 **0/557142**
58.178.130.178 - - [28/Nov/2023:13:33:04 -0700] "GET /InvoicePlane/index.php/sessions/login HTTP/1.1" 200 876 "http://rnsplasma.com/InvoicePlane/index.php/dashboard" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.0 Safari/605.1.15" 17 **0/17174**
58.178.130.178 - - [28/Nov/2023:13:33:07 -0700] "POST /InvoicePlane/index.php/sessions/login HTTP/1.1" 303 - "http://rnsplasma.com/InvoicePlane/index.php/sessions/login" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.0 Safari/605.1.15" 114 **0/114260**
58.178.130.178 - - [28/Nov/2023:13:33:07 -0700] "GET /InvoicePlane/index.php/dashboard HTTP/1.1" 200 4727 "http://rnsplasma.com/InvoicePlane/index.php/sessions/login" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.0 Safari/605.1.15" 37 **0/37371**
58.178.144.85 - - [28/Nov/2023:13:33:15 -0700] "GET /InvoicePlane/index.php/quotes/view/15 HTTP/1.1" 200 9441 "http://rnsplasma.com/InvoicePlane/index.php/dashboard" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.0 Safari/605.1.15" 29 **0/29988**
58.178.144.85 - - [28/Nov/2023:13:33:15 -0700] "GET /InvoicePlane/index.php/upload/upload_file/23/uRBvqhsUakoXdpA1FfKDE5cJYTG2rP3S HTTP/1.1" 200 22 "http://rnsplasma.com/InvoicePlane/index.php/quotes/view/15" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.0 Safari/605.1.15" 13 **0/13560**
58.178.130.178 - - [28/Nov/2023:13:33:19 -0700] "GET /InvoicePlane/index.php/dashboard HTTP/1.1" 307 - "http://rnsplasma.com/InvoicePlane/index.php/quotes/view/15" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.0 Safari/605.1.15" 12 **0/12099**
58.178.130.178 - - [28/Nov/2023:13:33:19 -0700] "GET /InvoicePlane/index.php/sessions/login HTTP/1.1" 200 873 "http://rnsplasma.com/InvoicePlane/index.php/quotes/view/15" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.0 Safari/605.1.15" 13 **0/13603**
218.214.252.7 - - [28/Nov/2023:13:49:32 -0700] "POST /InvoicePlane/index.php/sessions/login HTTP/1.1" 303 - "http://rnsplasma.com/InvoicePlane/index.php/sessions/login" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.0 Safari/605.1.15" 656 **0/656603**
218.214.252.7 - - [28/Nov/2023:13:49:33 -0700] "GET /InvoicePlane/index.php/dashboard HTTP/1.1" 200 4727 "http://rnsplasma.com/InvoicePlane/index.php/sessions/login" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.0 Safari/605.1.15" 29 **0/29695**
218.214.252.7 - - [28/Nov/2023:13:49:39 -0700] "GET /InvoicePlane/index.php/quotes/view/15 HTTP/1.1" 200 9440 "http://rnsplasma.com/InvoicePlane/index.php/dashboard" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.0 Safari/605.1.15" 24 **0/24204**
218.214.252.7 - - [28/Nov/2023:13:49:39 -0700] "GET /InvoicePlane/index.php/upload/upload_file/23/uRBvqhsUakoXdpA1FfKDE5cJYTG2rP3S HTTP/1.1" 200 22 "http://rnsplasma.com/InvoicePlane/index.php/quotes/view/15" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.0 Safari/605.1.15" 13 **0/13809**
218.214.252.7 - - [28/Nov/2023:13:49:48 -0700] "GET /InvoicePlane/index.php/dashboard HTTP/1.1" 200 4727 "http://rnsplasma.com/InvoicePlane/index.php/quotes/view/15" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.0 Safari/605.1.15" 26 **0/26961**

I admit I do not understand what is occurring. I don’t think this is an InvoicePlane issue, but would like to understand what is occurring. Can anyone point me in the right direction?

1 Like

Hi there, welcome.
I think it’s an issue with IP addresses.
Can you set this setting:
SESS_MATCH_IP=true => SESS_MATCH_IP=false in your ipconfig.php

Thank you.

I have added:

SESS_MATCH_IP=false

toward the end of the ipconfig.php file - just before this:

##
## DO NOT CHANGE ANY CONFIGURATION VALUES BELOW THIS LINE!
## =======================================================
##

I have checked that the setting does not already exist.

No change to the observed behavior.

Possibly I have misunderstood what you are asking me to do?

I have done a bit more poking around both the files installed on the web server and this forum.

application/config/config.php also has the setting referred to by @UnderDog:

$config['sess_match_ip'] = env('SESS_MATCH_IP', false);

This was true, and I have now set it to false.

This appears to have changed the observed behavior. Though the issue was somewhat random at times, so I’ll give it a day or two before declaring it resolved.

Thank you for your help :pray:

1 Like

Perfect! In versions 1.6 and beyond we show this as a config variable in ipconfig.php

Would you like to help out with developing InvoicePlane?
Here’s the invite link to Slack: Slack

@UnderDog - help out? Possibly.

I have been very impressed with InvoicePlane since I first installed it.

I have quite a few years IT experience, but none as a PHP developer I’m afraid. I spent maybe 12 months looking after some PHP code - but more from a support perspective - bug analysis and documentation for others to fix sort of thing. It is possible I would be more hindrance than help :joy:

1 Like

Just don’t worry anout being hindrance. Just remember: it’s open source, it’s supposed to be fun