NilObjectEx when adressing a label on a page

Hello

Small sketch of how the structure of my webapp is:
The webapp has a TCPSocket that connects to a service to for authentication etc. So I have made a session variable ‘socketManager’ that holds an instance of the class ManagerSocket.

This code is written in the ManagerSocket dataAvailable event:

[code]Dim ReceivedMsg As String = Me.ReadAll
Dim ReceivedArray() As String = ReceivedMsg.Split("|")

Select Case ReceivedArray(0)
Case “CredentialsWrong”
Session.pageLogin.lblError.Text = “Wrong username or password!”
End Select[/code]

So, what I think I’m doing:
If the string is “CredentialsWrong”, Go to the label lblError on the page pageLogin on the current Session and set the text to “Wrong username or password”

What I’m really doing:

Something wrong.
I get a NilObjectEx on that line, I assume it is because the dataAvailable event from that class cannot understand the current session, but how can I access the current session then?

Thank you for your time!

http://documentation.xojo.com/index.php/WebSessionContext

Thanks @Michel Bujardet I didn’t know this class!