[SOLVED] Best way to create session variables

Answered
0
0

Hi,

In WGX i used to create session variables with:
VWGContext.Current.Session.Item(“HostingMail_Type”)

for asp.net there is system.web.httpcontext.session

With WiseJ, what shoul I use, is there a WiseJ Session variables like it existed in WGX?

  • You must to post comments
Best Answer
0
0

In Wisej the Session object is dynamic so you can refer to any field without using the indexer:

Application.Session.IsLoggedOn = "whatever";

Application.Session.IsLoggedOn = true;

Application.Session.MyName = "Test";

etc.

To check the authenticated user you can use:

Application.User or Application.LogonUserIdentity.

We don’t use the Session.Items since we don’t use the ASP.NET session. You can simply do:

Application.Session.hostinguser = txtusername.Text.Trim();

Note: in VB.NET you need Strict Off to use dynamic objects. Otherwise use the indexer with the field name.

 

 

  • You must to post comments
0
0

Thanks Frank!

Where can i post a feature request, for the “IsLoggedOn” like in WGX, that when it turns into false he kill’s the app?

  • You must to post comments
0
0

Hi Jorge,

you can read/write session variables in Wisej as

Wisej.Web.Application.Session("Name")

Best regards
Frank

 

  • You must to post comments
0
0

Hi Again,

For WGX there was something that i liked, that was:

VWGContext.Current.Session.IsLoggedOn = True

and them we used the variables on it like below, how can i do this in WiseJ?
VWGContext.Current.Session.Item(“hostinguser”) = txtusername.Text.Trim

  • You must to post comments
0
0

Hi,

Any idea on this?

Jorge

  • You must to post comments
Showing 5 results
Your Answer

Please first to submit.