Solved

Context.Session is found null on postback,

Posted on 2007-11-21
10
994 Views
Last Modified: 2012-06-27
hi,

i am doing some work related to session in the Application_AuthenticateRequest even

when the page load , Current.Session object is perfect.

but when i click on submit of the login page and application_authenticateRequest is called.
is shows curent.session object is null.

how can i get the session object which i stored while login.

Thank
0
Comment
Question by:sitg
  • 5
  • 2
  • 2
  • +1
10 Comments
 
LVL 20

Accepted Solution

by:
REA_ANDREW earned 500 total points
ID: 20328480
HttpContext.Current.Session["YourSession"] is the fully qualified version.  You missed of the Context

Andrew
0
 
LVL 33

Expert Comment

by:raterus
ID: 20328603
I don't think it's possible to access the Session in Application_AuthenticateRequest
0
 

Author Comment

by:sitg
ID: 20328604
i mean the same
it is also returning null.
0
 

Author Comment

by:sitg
ID: 20328843
HttpContext.Current.Session is returing null
0
 
LVL 21

Expert Comment

by:surajguptha
ID: 20329162
Shouldnt the session get established only AFTER a successfull login??
0
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 
LVL 20

Expert Comment

by:REA_ANDREW
ID: 20329512
ahh I have mis read your question sorry.

Use a cookie to persist the data or


Andrew
Application["YourVariable"] = "YourValue";

Open in new window

0
 

Author Comment

by:sitg
ID: 20332770
hi,
but i want to store this information only session wise

my requirement is:
on succusfully login i store the iPrinciple object containing the roles in the session and on each request in the  Application_AuthenticateRequest, i want to  get the roles from the session instead of hitting the data store everytime.

but in Application_AuthenticateRequest it is returning "HttpContext.Current.Session" means Session containter itself is null , because my check
" if(HttpContext.Current.Session["aa"]==null) "
is  throwing the exception that "object reference is not set to instance of object"
0
 

Author Comment

by:sitg
ID: 20337466
my problem is still there.
no answer is resolving my problem
please help
0
 
LVL 33

Expert Comment

by:raterus
ID: 20349811
Again, Session is null and will always be null in Application_AuthenticateRequest, find another way.
0
 

Author Closing Comment

by:sitg
ID: 31410381
thanks .
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now