Will sessionID be empty if a session expired

Will sessionID be empty if a session expired

am 23.01.2007 00:51:18 von bettys

Hi all
I have a question for an ASP page. Usually I have some sort of session
variables
in my asp program and I use them to check if I need to display "your session
is expired and please start over( a link page people can start overagain if
the session is idled for more than 20 minutes in the middle of transactions.)

If I don't set up any session variable but trying to use SessionID to check,
it is OK, will sessionID become empty if the session is expired? Do you have
a better way?
Do you know what other program usually do?
Thank you.
--
Betty

RE: Will sessionID be empty if a session expired

am 23.01.2007 05:03:59 von stcheng

Hi Betty,

For SessionID in classic ASP, I think the ASP engine will make sure whether
the session from the current request is valid or expired(depend on the
cookie value). Then, if the original session has been expired, it will
start a new session, set a new session cookie. However, unlike ASP.NET,
classic ASP doesn't provide a property like IsNewSession so that you can
not simply detect whether a session is a new session. Yes, you can rely on
sessionID, but you need to always keep the last/old sessionID so that you
can compare. I don't think this is quite convenient to do in ASP. So IMO,
I would prefer storing a flag data in session for detect whether session
has been expired. In each page request, you can check that flag item(e.g.
Session("flag")). If that value doesn't exist, that means session state has
been expired. How do you think?

BTW, in ASP.NET the sessionID is abit more different. If you do not store
anything in Session, the ASP.NET runtime won't make your sessionID
fixed(will change on each request).

Please feel free to let me know if you have any questions or other ideas on
this.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no rights.

RE: Will sessionID be empty if a session expired

am 23.01.2007 18:01:01 von bettys

Thank you, Steven, I got it. Just like you said, in each page request, check
the session flag data will be much easier.
--
Betty


"Steven Cheng[MSFT]" wrote:

> Hi Betty,
>
> For SessionID in classic ASP, I think the ASP engine will make sure whether
> the session from the current request is valid or expired(depend on the
> cookie value). Then, if the original session has been expired, it will
> start a new session, set a new session cookie. However, unlike ASP.NET,
> classic ASP doesn't provide a property like IsNewSession so that you can
> not simply detect whether a session is a new session. Yes, you can rely on
> sessionID, but you need to always keep the last/old sessionID so that you
> can compare. I don't think this is quite convenient to do in ASP. So IMO,
> I would prefer storing a flag data in session for detect whether session
> has been expired. In each page request, you can check that flag item(e.g.
> Session("flag")). If that value doesn't exist, that means session state has
> been expired. How do you think?
>
> BTW, in ASP.NET the sessionID is abit more different. If you do not store
> anything in Session, the ASP.NET runtime won't make your sessionID
> fixed(will change on each request).
>
> Please feel free to let me know if you have any questions or other ideas on
> this.
>
> Sincerely,
>
> Steven Cheng
>
> Microsoft MSDN Online Support Lead
>
>
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
>

RE: Will sessionID be empty if a session expired

am 24.01.2007 02:02:32 von stcheng

You're welcome :)

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no rights.

RE: Will sessionID be empty if a session expired

am 24.01.2007 09:13:26 von exjxw.hannivoort

Steven Cheng[MSFT] wrote on 24 jan 2007 in
microsoft.public.inetserver.asp.general:

> You're welcome :)

Welcome on what?
Who is "you"?

Please always quote on usenet, this is NOT email.

> Sincerely,
>
> Steven Cheng
>
> Microsoft MSDN Online Support Lead
>
>
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
>
>



--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

Re: Will sessionID be empty if a session expired

am 25.01.2007 20:23:46 von Dave Anderson

Evertjan. wrote:
>> You're welcome :)
>
> Welcome on what?
> Who is "you"?
>
> Please always quote on usenet, this is NOT email.

Perhaps it's time for you to upgrade from RN to TRN, Evertjan.




--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms.

Re: Will sessionID be empty if a session expired

am 25.01.2007 20:44:34 von exjxw.hannivoort

Dave Anderson wrote on 25 jan 2007 in
microsoft.public.inetserver.asp.general:

> Evertjan. wrote:
>>> You're welcome :)
>>
>> Welcome on what?
>> Who is "you"?
>>
>> Please always quote on usenet, this is NOT email.
>
> Perhaps it's time for you to upgrade from RN to TRN, Evertjan.

1 I have no idea what those letters mean, Dave, perhaps news readers?

2 Since the netiquette adagium "always quote" is ment to remedy the
impossibility to be certain that the whole thread is yet and stays long
enough on all news servers, the advice of upgrading is not a good advice
for not following netiquette.


--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

Re: Will sessionID be empty if a session expired

am 25.01.2007 21:35:33 von Dave Anderson

Evertjan. wrote:
>> Perhaps it's time for you to upgrade from RN to TRN, Evertjan.
>
> 1 I have no idea what those letters mean, Dave, perhaps news readers?
>
> 2 Since the netiquette adagium "always quote" is ment to remedy the
> impossibility to be certain that the whole thread is yet and stays
> long enough on all news servers, the advice of upgrading is not a
> good advice for not following netiquette.

It was a joke, Evertjan. [trn] was an improvement on [rn], namely that it
added threading to a newsreader for the first time (circa 1989).



--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms.

Re: Will sessionID be empty if a session expired

am 25.01.2007 21:59:37 von exjxw.hannivoort

Dave Anderson wrote on 25 jan 2007 in
microsoft.public.inetserver.asp.general:

> Evertjan. wrote:
>>> Perhaps it's time for you to upgrade from RN to TRN, Evertjan.
>>
>> 1 I have no idea what those letters mean, Dave, perhaps news readers?
>>
>> 2 Since the netiquette adagium "always quote" is ment to remedy the
>> impossibility to be certain that the whole thread is yet and stays
>> long enough on all news servers, the advice of upgrading is not a
>> good advice for not following netiquette.
>
> It was a joke, Evertjan. [trn] was an improvement on [rn], namely that
> it added threading to a newsreader for the first time (circa 1989).

I thought the Royal Navy did not need an improvement.

My days of unix usenet are far behind, since 1996, I think, Dave,
and wasn't I using Tin then?

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)