B4J Question Problems related to invalid cookies header

saeed10051

Active Member
Licensed User
Longtime User
I am trying to run a server with B4J using following article
When i run the B4J program i get the following lines in the log. there is a warning for invalid cookie header, has anyone else faced this invalid cookie header problem. However at the end it is showning Update duckdns ok. When i try to connect to this server from my mobile it doesnt work. The page doesnt load.

Waiting for debugger to connect...
Program started.
2020-05-09 15:38:27.522:INFO::main: Logging initialized @1211ms to org.eclipse.jetty.util.log.StdErrLog
2020-05-09 15:38:27.684:INFO:eek:ejs.Server:main: jetty-9.4.z-SNAPSHOT; built: 2018-05-03T15:56:21.710Z; git: daa59876e6f384329b122929e70a80934569428c; jvm 11.0.1+13
2020-05-09 15:38:27.788:INFO:eek:ejs.session:main: DefaultSessionIdManager workerName=node0
2020-05-09 15:38:27.788:INFO:eek:ejs.session:main: No SessionScavenger set, using defaults
2020-05-09 15:38:27.791:INFO:eek:ejs.session:main: node0 Scavenging every 660000ms
2020-05-09 15:38:27.799:INFO:eek:ejsh.ContextHandler:main: Started o.e.j.s.ServletContextHandler@4b8ee4de{/,file:///C:/javaprojects/duck%20dns%20server/FileServer-B4J/FileServer/Objects/www,AVAILABLE}
2020-05-09 15:38:27.805:INFO:eek:ejs.AbstractNCSARequestLog:main: Opened C:\javaprojects\duck dns server\FileServer-B4J\FileServer\Objects\logs\b4j-2020_05_09.request.log
2020-05-09 15:38:27.830:INFO:eek:ejs.AbstractConnector:main: Started ServerConnector@6892b3b6{HTTP/1.1,[http/1.1]}{0.0.0.0:51042}
2020-05-09 15:38:27.831:INFO:eek:ejs.Server:main: Started @1531ms
Emulated network latency: 100ms
Server started
May 09, 2020 3:38:28 PM org.apache.http.client.protocol.ResponseProcessCookies processCookies
WARNING: Invalid cookie header: "Set-Cookie: AWSALB=iNW22wMcYX4X/8fMoAF5MBRkwf0hxOC2U9GcxZBUn0p0wsLmuOWQZ3IZAiJjG45/XVtzP92RT/xnXmp1XCGb1gCKkwOU9WFeR+lEaD5IQPVNzxRjSITFf++tTUke; Expires=Sat, 16 May 2020 11:38:28 GMT; Path=/". Unable to parse expires attribute: Sat, 16 May 2020 11:38:28 GMT
May 09, 2020 3:38:28 PM org.apache.http.client.protocol.ResponseProcessCookies processCookies
WARNING: Invalid cookie header: "Set-Cookie: AWSALBCORS=iNW22wMcYX4X/8fMoAF5MBRkwf0hxOC2U9GcxZBUn0p0wsLmuOWQZ3IZAiJjG45/XVtzP92RT/xnXmp1XCGb1gCKkwOU9WFeR+lEaD5IQPVNzxRjSITFf++tTUke; Expires=Sat, 16 May 2020 11:38:28 GMT; Path=/; SameSite=None". Unable to parse expires attribute: Sat, 16 May 2020 11:38:28 GMT
Update DuckDNS: OK
I have set the port forwarding as specified in the tutorial
 

MicroDrie

Well-Known Member
Licensed User
Longtime User
Let first try to find what has access and what is blocking where.

The first step is the bypass the Windows firewall to check a correct working program:
  1. open a browser on the same PC as the webserver
  2. Type the following url:
  3. 127.0.0.1:54021/test
  4. Use the keycombinatie Windows + R to open a command window
  5. Type the following command
  6. ipconfig/all
  7. Search for the results of the "Wireless LAN adapter Wi-Fi:" for the IPv4 Address (This gives for example 192.168.178.38)
  8. Replace the address 127.0.0.1 in the url found in de command box (in my example 192.168.178.38) in your browser
  9. 192.168.178.38:54021/test
  10. Open a browser on the telephone which is connect to the same wifi network
  11. Add the same command with your wireless address of the wifi interface to url search bar
  12. 192.168.178.38:54021/test
Now every step should be successful by displaying the test page. The fact that the log shows Update DuckDNS: OK llooks that the connection to the Internet and DuckDNS works correctly. s can have two different WiFi networks. Standard network behavior could route traffic from both WiFi networks only to the Internet. You can check your IPv4 Address, Subnet Mask and Default Gateway addresses on both the server and the WiFi connected mobile phone. As a rule of thumb, the first address is unique, the last two must be the same to communicate.

Your router has a LAN Interface address which is accessible from the Internet. If you disable the WiFi interface on your mobile phone, the mobile phone is enforce to communicate via your provider over the Internet. A provider can block the external port that is used by port forwarding of your router. You can check this while you WiFi interface is disabled and try to connect to the public LAN address of your router which has the port forwarding. I don't think this is the case because DuckDNS is working (and use the same route over the Internet).
If you cannot see the test page in this case, there problem may arise between the mobile network from you telephone provider to the Internet. The question arise and which you must try is: can someone else with a PC and someone other mobile phone provider successful retrieve your test page with the following command whereby you replace the text between <> by the actual values?
  1. <ROUTER public LAN address>:<Public Port Address>/test
Go through the steps indicated including the step over the internet to see if you have a router configuration challenge or if your mobile phone provider is the challenge.
 
Upvote 0

saeed10051

Active Member
Licensed User
Longtime User
Let first try to find what has access and what is blocking where.

The first step is the bypass the Windows firewall to check a correct working program:
  1. open a browser on the same PC as the webserver
  2. Type the following url:

  3. Use the keycombinatie Windows + R to open a command window
  4. Type the following command

  5. Search for the results of the "Wireless LAN adapter Wi-Fi:" for the IPv4 Address (This gives for example 192.168.178.38)
  6. Replace the address 127.0.0.1 in the url found in de command box (in my example 192.168.178.38) in your browser

  7. Open a browser on the telephone which is connect to the same wifi network
  8. Add the same command with your wireless address of the wifi interface to url search bar
Now every step should be successful by displaying the test page. The fact that the log shows Update DuckDNS: OK llooks that the connection to the Internet and DuckDNS works correctly. s can have two different WiFi networks. Standard network behavior could route traffic from both WiFi networks only to the Internet. You can check your IPv4 Address, Subnet Mask and Default Gateway addresses on both the server and the WiFi connected mobile phone. As a rule of thumb, the first address is unique, the last two must be the same to communicate.

Your router has a LAN Interface address which is accessible from the Internet. If you disable the WiFi interface on your mobile phone, the mobile phone is enforce to communicate via your provider over the Internet. A provider can block the external port that is used by port forwarding of your router. You can check this while you WiFi interface is disabled and try to connect to the public LAN address of your router which has the port forwarding. I don't think this is the case because DuckDNS is working (and use the same route over the Internet).
If you cannot see the test page in this case, there problem may arise between the mobile network from you telephone provider to the Internet. The question arise and which you must try is: can someone else with a PC and someone other mobile phone provider successful retrieve your test page with the following command whereby you replace the text between <> by the actual values?
Go through the steps indicated including the step over the internet to see if you have a router configuration challenge or if your mobile phone provider is the challenge.
Hi Micro drie
Thanks for the detailed info.
I have checked upto point 12 in your message, and it is showing test page both in my pc (server) and my mobile phone while it is connected to the same wifi as the server.
However when i try to write my router ip address in the mobile browser while it is connected to my 4G data provider then the page doesnt load
Another point is that when i go to see my router LAN settings (attached), i see my ip address as 192.168.10.1 while when i go to whatismyip.com i see an entirely different ip public address. I have checked with both but the page on my mobile browser is not loading while i am connected to data provider instead of wifi.
I am using chrome both on my pc and my mobile
 

Attachments

  • address.jpg
    address.jpg
    162.1 KB · Views: 277
Upvote 0

OliverA

Expert
Licensed User
Longtime User
Your service provider is giving you a non-public IP address and therefore you are unreachable via normal dynamic dns means
 
Upvote 0

OliverA

Expert
Licensed User
Longtime User
But when i go to whatismyip.com, it specifies my public ip address
The IP address assigned by your ISP to your router is 192.158.100.9 . That is a private IP address. whatismyip.com does show you a public IP address, but that is the address of your ISP’s router. Your ISP is using NAT (or something to that effect) to assign private IP numbers to its customers. It could be that some default ports are forwarded to the private IP addresses, but it would make sense that non-standard ports are not forwarded. So access to your routers page may work (since you are most likely accessing it via port 80 or 443), but the custom port is blocked/not forwarded.
 
Upvote 0

OliverA

Expert
Licensed User
Longtime User
Upvote 0

saeed10051

Active Member
Licensed User
Longtime User
I have checked with port 80. When my phone is on same wifi network then i get a page showing that your connection is not private
while when i am on 4G then it shows that page cannot be loaded.
 
Upvote 0
Top