May be this is a silly Question, How to check These two conditions ,
1.The session is not expired but , the session variable is not assigned any value.
2. Session variable is assigned with value, but session is expired.
if(Session["mykey"] != null)
{
// Session is not expired
}
else
{
// Session is expired
}
Will this condition work for above two scenarios, or do i have to handle this both differently.
Please Help.

Sanjay KumarRank #561 · 4.3K reputationPosted Dec 2, 2013, 12:23 AM EST
http://www.codeproject.com/Articles/32545/Exploring-Session-in-ASP-Net
Sanjeeb LenkaRank #301 · 8.3K reputationPosted Dec 2, 2013, 12:23 AM EST
Tanuj KhuranaRank #3,188 · 450 reputationPosted Dec 2, 2013, 12:41 AM EST
Vishwas Kadamannaya111 reputationPosted Dec 2, 2013, 12:41 AM EST
Actually Session["mykey"] my session variable may or maynot be assigned any value, which depends on the code, so i only want to check the session expired or not.
How to do that, only to check the session expired or not, the above code will work fine if the session variable is assigned any value, if it is not assigned always i will get null, even if session not expired..
Please Help.