To get session id of the current user
HttpSessionState ss = HttpContext.Current.Session;
HttpContext.Current.Session["test"] = "test";
HttpContext.Current.Response.Write(ss.SessionID);
To check wheather current session expire
check Session["test"]==null