I know this is an old post but there is no correct answer and I needed this answered.
I have used Ashwin's answer somewhat and made it work!
You need to create the session["SessionStart"] variable where ever you start your session and begin your session. From there it is pretty straight forward, I am returning seconds as the value so I can use javascript to change the seconds to hh:mm:ss, I have also included a string.format to convert the seconds into hh:mm:ss.
// Get the session in minutes and seconds
HttpSessionState session = HttpContext.Current.Session;//Return current session
DateTime? sessionStart = session["SessionStart"] as DateTime?;//Get DateTime object SessionStart
//Check if session has not expired
if (sessionStart.HasValue)
{
TimeSpan timepassed = DateTime.Now - sessionStart.Value;//Get the time passed since the session was created
int TimeOut = (session.Timeout * 60) - Convert.ToInt32(remaining.TotalSeconds);
int h = (TimeOut / 3600);
int m = ((TimeOut / 60) % 60);
int s = TimeOut % 60;
SessionTimeoutValue.InnerText += TimeOut; // or use the string.format below.
//string.Format("{0}:{1}:{2}",
// h,
// m,
// s);
}