c# - ASP.NET Website HttpContext.Items is empty at random in HTTPHANDLER -


i having trouble accessing httpcontext.items[typeof(userprofile)] object when http handler called, userprofile object stored in session cookie via forms authentication.

it works 100% of time when open browser on same machine being deployed or debugging in visual studio, fails out randomly when test remote computer. put in tracing, , httpcontext.items[typeof(userprofile)] null when session cookie passed successfully, according fiddler.

i have tried implementing ireadonlysessionstate in httphandler still not work. realise sometimes, after 3 minutes or more of logging in, works 100% of time after that.

any ideas on why might happening , solution?

thx

session state, forms authentication andhttpcontext.items unrelated - not sure why mixing them up. forms authentication has own cookie separate session cookie , life time can different. can have session state irrespective of user has been authenticated or not. not how storing useprofile object in session cookie - advise put code.

httpcontext.items property bag associated each httprequest - note collection available request life time , there no built-in mechanism persist collection. unlikely going userprofile object in collection unless putting there each request in module or global.asax. need explain doing perhaps code samples!


Comments

Popular posts from this blog

c++ - Is it possible to compile a VST on linux? -

java - Output of Eclipse is rubbish -

jquery - Confused with JSON data and normal data in Django ajax request -