Solved

Context.Session is found null on postback,

Posted on 2007-11-21
10
996 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
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 

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
 
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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

777 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