Click here to Skip to main content
Sign Up to vote bad
good
See more: C#ASP.NET
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 31 Jan '13 - 20:37

Comments
AshishChaudha - 1 Feb '13 - 3:05
Did not understand your question!! please elaborate your question with some code sample.
Marco Alessandro Bertschi - 1 Feb '13 - 4:31
Where are you hosting the App? Sessions do not work if the App is located on a Server farm because they are machine-specific.
hemantrautela - 1 Feb '13 - 4:31
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:17
try adding the session in your content page (login page) and check and provide more details
Kishor Deshpande - 2 Feb '13 - 6:33
Can you please share details, Session state mode?? Cookieless?

2 solutions

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
  Permalink  
check this...
session["username"]=txtusername.text;
otherwisewise
session.add("username")=txtusername.text;
  Permalink  

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

  Print Answers RSS
Your Filters
Interested
Ignored
     
0 OriginalGriff 325
1 Aarti Meswania 250
2 Sergey Alexandrovich Kryukov 249
3 Slacker007 240
4 Ron Beyer 190
0 Sergey Alexandrovich Kryukov 8,743
1 OriginalGriff 7,124
2 CPallini 3,678
3 Rohan Leuva 3,011
4 Maciej Los 2,403


Advertise | Privacy | Mobile
Web04 | 2.6.130516.1 | Last Updated 12 Feb 2013
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid