How to get a session value? (wodWebServer / wodWebServer.NET)
I write some code in RequestDoneEvent to get session value saved in asp.net.
It always return nothing.
Ex:
If Not Args.User.SessionVars("ConnectDate") Is Nothing Then
AddTraceLine(Args.User.SessionVars("ConnectDate").ToString())
End If
How to get a session value?
Hi Jeremy.
Can you tell me where do you set ConnectDate session variable? Or you can attach sample project and send it to techsupport so we can try it out.
Warm regards.
Jasmine.
How to get a session value?
Hi Jasmine,
This is a simple sample.
In the ASP.NET Page_Load Event
If Session("ConnectDate") = "" Then
Session("ConnectDate") = Now.ToLongTimeString()
End IF
Label1.Text = Session("ConnectDate")
I need a sample to read the session value in wodWebServer.Net.
BTW, the sample in online help does not work.
WebServer.NET/Help/wodWebServer.NET-WeOnlyDo.Server.WebUser-SessionVars-property.html
If User.SessionVars.Exists("MyCount") Then
User.SessionVars("MyCount") = User.SessionVars("MyCount") + 1
Else
User.SessionVars.Add("MyCount").Value = 1
End If
I could not find a method named "Exists"
How to get a session value?
Hi,
I think that if you see the line of code of yours below:
Label1.Text = Session("ConnectDate")
Label1.Caption = Session("ConnectDate") , should have been used instead !
I don't know if Lable control has text property ?
Label has TAG & Caption properties as I checked my VB6 Software.
and may be that is why you see no return value.
Regards.
How to get a session value?
Hi Jeremy.
I think you're accessing ASP.NET's Session object when setting the Session, and then accessing User.SessionVars from wodWebServer.NET. These are two different collections, and we can't access ASP.NET's session collection.
Can you try to set it through User.SessionVars collection?
Kind regards.
Jasmine.
How to get a session value?
Thanks.