alwaysbusy Expert Licensed User Longtime User Sep 6, 2017 #1 When jServer is started with SSL, the ServletRequest in the upload handler looses the session. I first thought this was a problem in my WebApp, but it looks like I can reproduce this with the ServerExampleNoMySQL.zip from the Web Apps tutorial too (https://www.b4x.com/android/forum/threads/webapp-web-apps-overview.39811/) Situation: In the WebSocketWithFileUpload class, a session variable for the callback is set: B4X: ws.Session.SetAttribute("file_upload_sender", Me) In the FileHelper class it is retrieved to be used in the CallSub B4X: Dim callback As Object = req.GetSession.GetAttribute("file_upload_sender") Results: When calling https://localhost:51143/websocket_with_fileupload/, everything works as expected. But when calling http://localhost:51042/websocket_with_fileupload/, the value of callback is null. Maybe something changed when Jetty was upgraded?
When jServer is started with SSL, the ServletRequest in the upload handler looses the session. I first thought this was a problem in my WebApp, but it looks like I can reproduce this with the ServerExampleNoMySQL.zip from the Web Apps tutorial too (https://www.b4x.com/android/forum/threads/webapp-web-apps-overview.39811/) Situation: In the WebSocketWithFileUpload class, a session variable for the callback is set: B4X: ws.Session.SetAttribute("file_upload_sender", Me) In the FileHelper class it is retrieved to be used in the CallSub B4X: Dim callback As Object = req.GetSession.GetAttribute("file_upload_sender") Results: When calling https://localhost:51143/websocket_with_fileupload/, everything works as expected. But when calling http://localhost:51042/websocket_with_fileupload/, the value of callback is null. Maybe something changed when Jetty was upgraded?
alwaysbusy Expert Licensed User Longtime User Sep 6, 2017 #2 Unless in that case, the commented line srvr.AddFilter("/*", "HttpsFilter", False) is really important? If I uncomment it, all works fine again. But that undos the whole purpose I think as the user will be redirected to the https anyway. Last edited: Sep 6, 2017 Upvote 0
Unless in that case, the commented line srvr.AddFilter("/*", "HttpsFilter", False) is really important? If I uncomment it, all works fine again. But that undos the whole purpose I think as the user will be redirected to the https anyway.
Erel B4X founder Staff member Licensed User Longtime User Sep 6, 2017 #3 As you wrote, the purpose of HttpsFilter is to redirect the traffic to the https port. I will check this issue tomorrow. Upvote 0
As you wrote, the purpose of HttpsFilter is to redirect the traffic to the https port. I will check this issue tomorrow.
Erel B4X founder Staff member Licensed User Longtime User Sep 7, 2017 #4 I've tested it from two different browsers. One connected to https and one connect to http. It worked properly. I guess that the problem is related to the cookies getting mixed and it will only happen when connecting to both ports from the same browser. Upvote 0
I've tested it from two different browsers. One connected to https and one connect to http. It worked properly. I guess that the problem is related to the cookies getting mixed and it will only happen when connecting to both ports from the same browser.
alwaysbusy Expert Licensed User Longtime User Sep 7, 2017 #5 Erel said: when connecting to both ports from the same browser Click to expand... And again you are correct sir! That was indeed what I tried yesterday. Used two different browsers and no problem occurred. Upvote 0
Erel said: when connecting to both ports from the same browser Click to expand... And again you are correct sir! That was indeed what I tried yesterday. Used two different browsers and no problem occurred.