asp.net - Capturing a Session variable in Session_OnStart - Global.asa -


i'm trying use users session process code in global.asa:

sub session_onstart   sadmin = session("admin")         application("admin") = sadmin 

the session("admin") not empty, application("admin") comes empty when check it. there reason i'm not able capture users session variable in session_onstart section of global.asa?

when application("admin") doesn't come empty, comes hi

sub session_onstart   application("admin") = "hi" 

what have capture users session value in global.asa?

it appears try set "by reference" assignment application("admin") change when session("admin") changes. fear such thing not possible in classic asp.

the elegant way can think of adding helper method included in pages:

sub assignadminsession(value)     session("admin") = value     application("admin") = value end sub 

then instead of session("admin") = "something" have everywhere:

call assignadminsession("value here") 

Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -