bluewind44 wrote:
Hello, all.
Is there any case that session vaiables expire before the time-out?
Now, I'm developing the UI project that use the webservice project.
Ocationally I met the situation that I mentioned before.
Thanks.
Session variables don't expire before the end of the session.
They can be *removed* before the end, or you have a different
session than you think.
You mention WebService. Webservices by default do *not* use
Session (for speed). So it you try to store something in Session in one
call and then use that in a next call, the value is gone (or even more
drastic: "Session" is null, so you get an error when you try to store anything)
To enable sessions for webservices:
1) use [WebMethod(EnableSession=true)] on the webservice method
2) create a CookieContainer (that's the name, I think) and add it to
the webservice proxy at the calling side (there is a property with a similar name).
Then use the same proxy or at least the same container for both calls.
Hans Kesting