Click here to Skip to main content
15,884,629 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hi,

I'm using master page in my web application, my problem is, session is null in all content pages. of course session is created by Login page that is using master page.

each Content Page and web.config set properly for enableSessionState =true
but there is no Session enable property in Master Page,

and in Content page IsNewSession Property returns true ???
is it create new session in Content Page ?


any help !! thanks in advance.
Posted
Comments
AshishChaudha 1-Feb-13 3:05am    
Did not understand your question!! please elaborate your question with some code sample.
Marco Bertschi 1-Feb-13 4:31am    
Where are you hosting the App?
Sessions do not work if the App is located on a Server farm because they are machine-specific.
Hemant Singh Rautela 1-Feb-13 4:31am    
Didn't getting you properly,

Just add Session in start page (whichever you want as login page)
Session["keyname"]=keyvalue;
and after login you can use anywhere that session.
string var_name = Session["keyname"].toString();
Needn't to enable/disable anywhere...
joe_j 1-Feb-13 8:17am    
try adding the session in your content page (login page) and check and provide more details
Kishor Deshpande 2-Feb-13 6:33am    
Can you please share details,
Session state mode??
Cookieless?

Hi All,


I Got the Final Solution, The only reason why HttpContext.Current.Session returning null is because i am set CookieLess =true in web.config , which is default false if i want to access HttpContext.Current.Session from outside the web project.


Thanks
 
Share this answer
 
check this...
session["username"]=txtusername.text;
otherwisewise
session.add("username")=txtusername.text;
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900