How to get a session value? - WeOnlyDo Discussion board

How to get a session value? (wodWebServer / wodWebServer.NET)

by Jeremy, Wednesday, October 29, 2014, 03:10 (3677 days ago) @ Jasmine

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"


Complete thread: