I am trying to solve a problem where the session id seems to clearing mysteriously during postback. I am sure that the value is being set and there is no other place in my code where i am clearing that session. Also, I am storing the value of the session id in my page's viewstate. During the postback the viewstate is empty which essentially means that when the value was assigned to viewstate the session variable was null. Is it possible that during code execution, session object is cleared because of timeout?
So lets say if i have following code.
if (session["id"] == null) :line1
{ :line2
session["id"] = // Generate some unique id :line3
} :line4
viewstate["id"] = session["id"]; :line5
is it be theoretically possible that even though session["id"] is not null in line1 it is null on line5 because of time out.