Hi,
I'm testing the Chatroom example from Erel, the webapp works fine in Windows browser, Android browser, but when I tried to connect with an Iphone browser (Safari and Chrome) I set the username but when the Chat Page loads returns to Login Page.
That's because the ws.Session.HasAttribute("name") returns False and ws.Session.GetAttribute("name") returns Null
Anybody knows why and how to fix it?
Thank you all !!
Link to the Chatroom example: https://www.b4x.com/android/forum/t...ads-sessions-and-server-events.39969/#content
Here is the original code in the example that lost the session attributes in iphone browsers :
I'm testing the Chatroom example from Erel, the webapp works fine in Windows browser, Android browser, but when I tried to connect with an Iphone browser (Safari and Chrome) I set the username but when the Chat Page loads returns to Login Page.
That's because the ws.Session.HasAttribute("name") returns False and ws.Session.GetAttribute("name") returns Null
Anybody knows why and how to fix it?
Thank you all !!
Link to the Chatroom example: https://www.b4x.com/android/forum/t...ads-sessions-and-server-events.39969/#content
Here is the original code in the example that lost the session attributes in iphone browsers :
Chatroom example:
Private Sub WebSocket_Connected (WebSocket1 As WebSocket)
ws = WebSocket1
If ws.Session.HasAttribute("name") = False Then
'name not found. Go to the login page. This will happen if the user goes to the chat page directly.
WebUtils.RedirectTo(ws, "index.html")
Else
name = ws.Session.GetAttribute("name")
ws.Session.RemoveAttribute("name") 'remove the attribute
'the user will be redirected to the login page next time.
CallSubDelayed3(ChatShared, "NewConnection", Me, name)
txt.RunMethod("select", Null)
End If
End Sub
Last edited: