Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > preventing session variables from going null

Reply
Thread Tools

preventing session variables from going null

 
 
javelin
Guest
Posts: n/a
 
      12-18-2006
In ASP classic pages, I want to know if it's possible to prevent
session variables from becoming zero length strings? I have tried
setting the Session.Timeout to a large value, but alwas, after 20
minutes, my session variable times out. I also tried setting the
session timeout in IIS manager to a high value, but this did no good
either.

I just want to allow one particular session variable to last a long
time. Any other suggestions? \

Thanks.

 
Reply With Quote
 
 
 
 
Mike Brind
Guest
Posts: n/a
 
      12-18-2006

"javelin" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) ps.com...
> In ASP classic pages, I want to know if it's possible to prevent
> session variables from becoming zero length strings? I have tried
> setting the Session.Timeout to a large value, but alwas, after 20
> minutes, my session variable times out. I also tried setting the
> session timeout in IIS manager to a high value, but this did no good
> either.
>
> I just want to allow one particular session variable to last a long
> time. Any other suggestions? \
>


Session Variables live as long as the session (unless you explicitly
terminate them before that). If you want a value to persist beyond the life
of a session, then by definition, this can't be done using a session
variable. You will need to use a different mechanism - database/text
file/application variable...

--
Mike Brind


 
Reply With Quote
 
 
 
 
Evertjan.
Guest
Posts: n/a
 
      12-18-2006
Mike Brind wrote on 18 dec 2006 in
microsoft.public.inetserver.asp.general:

>
> "javelin" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed) ps.com...
>> In ASP classic pages, I want to know if it's possible to prevent
>> session variables from becoming zero length strings? I have tried
>> setting the Session.Timeout to a large value, but alwas, after 20
>> minutes, my session variable times out. I also tried setting the
>> session timeout in IIS manager to a high value, but this did no good
>> either.
>>
>> I just want to allow one particular session variable to last a long
>> time. Any other suggestions? \
>>

>
> Session Variables live as long as the session (unless you explicitly
> terminate them before that). If you want a value to persist beyond
> the life of a session, then by definition, this can't be done using a
> session variable. You will need to use a different mechanism -
> database/text file/application variable...


In other words:

Session variables never time out,
they just fade away ...

.... when the session ends.



Preventing the session from ending is all that is required.


--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
 
Reply With Quote
 
Anthony Jones
Guest
Posts: n/a
 
      12-19-2006

"javelin" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) ps.com...
> In ASP classic pages, I want to know if it's possible to prevent
> session variables from becoming zero length strings? I have tried
> setting the Session.Timeout to a large value, but alwas, after 20
> minutes, my session variable times out. I also tried setting the
> session timeout in IIS manager to a high value, but this did no good
> either.
>
> I just want to allow one particular session variable to last a long
> time. Any other suggestions? \


That's strange. Session variables should survive for at least the period
specified as the session timeout in IIS Manager.

Is this Win2K3 IIS6? If so do you have periodic recycling enabled on the
application pool your ASP app belongs to?

You are aware that if you close your browser you are no longer able to
access the session, right?


>
> Thanks.
>



 
Reply With Quote
 
javelin
Guest
Posts: n/a
 
      12-19-2006
I'm aware of how session variables work, but can't figure out why the
session timeout settings are being ignored. I can't find anything in
the code (300+ pages worth) that would explain why this particular
variable gets set to "", but there is got that checks if the value is
set to "", and if so, it closes the browser.

I know the server is Windows Server 2003, SP1, if that helps.

Thanks.

Anthony Jones wrote:
> "javelin" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed) ps.com...
> > In ASP classic pages, I want to know if it's possible to prevent
> > session variables from becoming zero length strings? I have tried
> > setting the Session.Timeout to a large value, but alwas, after 20
> > minutes, my session variable times out. I also tried setting the
> > session timeout in IIS manager to a high value, but this did no good
> > either.
> >
> > I just want to allow one particular session variable to last a long
> > time. Any other suggestions? \

>
> That's strange. Session variables should survive for at least the period
> specified as the session timeout in IIS Manager.
>
> Is this Win2K3 IIS6? If so do you have periodic recycling enabled on the
> application pool your ASP app belongs to?
>
> You are aware that if you close your browser you are no longer able to
> access the session, right?
>
>
> >
> > Thanks.
> >


 
Reply With Quote
 
Anthony Jones
Guest
Posts: n/a
 
      12-19-2006

"javelin" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) ups.com...
> I'm aware of how session variables work, but can't figure out why the
> session timeout settings are being ignored. I can't find anything in
> the code (300+ pages worth) that would explain why this particular
> variable gets set to ""


Is it really getting set to "" or is in fact Empty (test using IsEmpty
function)?
'why this particular variable gets set to ""' suggest that you have other
session variables that survive longer, is that so?


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ASP.net (vb.net) session query - preventing a user from accessing apage while another user is viewing that page brendan_gallagher_2001@yahoo.co.uk ASP .Net 2 04-22-2008 04:57 PM
Put variables into member variables or function variables? tjumail@gmail.com C++ 9 03-23-2008 04:03 PM
Preventing changes to a module's variables in mod_perl max@maxgraphic.com Perl Misc 9 09-19-2006 01:40 PM
"stringObj == null" vs "stringObj.equals(null)", for null check?? qazmlp1209@rediffmail.com Java 5 03-29-2006 10:37 PM
session variables end up null Abraham Luna ASP .Net 4 09-09-2005 05:17 PM



Advertisments