sitg
asked on
Context.Session is found null on postback,
hi,
i am doing some work related to session in the Application_AuthenticateRe quest even
when the page load , Current.Session object is perfect.
but when i click on submit of the login page and application_authenticateRe quest is called.
is shows curent.session object is null.
how can i get the session object which i stored while login.
Thank
i am doing some work related to session in the Application_AuthenticateRe
when the page load , Current.Session object is perfect.
but when i click on submit of the login page and application_authenticateRe
is shows curent.session object is null.
how can i get the session object which i stored while login.
Thank
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I don't think it's possible to access the Session in Application_AuthenticateRe quest
ASKER
i mean the same
it is also returning null.
it is also returning null.
ASKER
HttpContext.Current.Sessio n is returing null
Shouldnt the session get established only AFTER a successfull login??
ahh I have mis read your question sorry.
Use a cookie to persist the data or
Andrew
Use a cookie to persist the data or
Andrew
Application["YourVariable"] = "YourValue";
ASKER
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_AuthenticateRe quest, i want to get the roles from the session instead of hitting the data store everytime.
but in Application_AuthenticateRe quest it is returning "HttpContext.Current.Sessi on" means Session containter itself is null , because my check
" if(HttpContext.Current.Ses sion["aa"] ==null) "
is throwing the exception that "object reference is not set to instance of object"
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_AuthenticateRe
but in Application_AuthenticateRe
" if(HttpContext.Current.Ses
is throwing the exception that "object reference is not set to instance of object"
ASKER
my problem is still there.
no answer is resolving my problem
please help
no answer is resolving my problem
please help
Again, Session is null and will always be null in Application_AuthenticateRe quest, find another way.
ASKER
thanks .