Solved

Check if Session has expired

Posted on 2014-11-05
1
93 Views
Last Modified: 2015-01-25
How can I check if Session has expired?
Something like this (it is not working - I get Input string was not in correct format).
if (Session["UserId"]!=null)
{
}
0
Comment
Question by:johnson1
1 Comment
 
LVL 36

Accepted Solution

by:
Miguel Oz earned 500 total points
ID: 40425079
You could use the IsSessionExpired method described here.
This method relies on Session.IsNewSession  and a cookie to detect whether the session has expired or not.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Upgrade code from VS 2010 to VS 2015 7 33
Coding for the first time 9 68
Set custom font WPF 2 21
Need help with a query 14 39
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.

733 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