Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Session Timeout Event never happens?

Reply
Thread Tools

Session Timeout Event never happens?

 
 
Tim W.
Guest
Posts: n/a
 
      12-19-2004
Folks.

In a B2B Procurement system we've created, we got following Session-Issue:

Configuration: We are using IIS 6.0 and added SQL-Based-Sessions in
web.config with a timeout of 240 minutes and set them to cookieless mode.
As well we added Session.Timeout=240 in asp.net-application and saved data
into the session.

Session-Timeout in IIS is also set to 240.

When looking at the ASPStateTempSessions table, we can see Expires field
which has the correct expirery-value.

Problem: We don't ever get any timeout. Session seems to be still alive
after 14 hours. If we call session with session-id in url, we get all values
we set before out of the session.

As well we tried to set session-timeout to 1minute, but same thing happened
(in application and IIS and web.config) Also we tried to disable
Session-State in IIS. But everytime the same result: Session gets not
destroyed (Session.Abandon()) after expirery-time passed.

Did we overlook something? What keeps the session alive?

Thanks for help in advance,

Tim ((E-Mail Removed))


 
Reply With Quote
 
 
 
 
Juan T. Llibre [MVP]
Guest
Posts: n/a
 
      12-19-2004
Is SQL Server Agent running ?

See http://www.dbazine.com/cook9.shtml

"The InstallSqlState.sql script creates a job called
ASPState_Job_DeleteExpiredSessions to delete
expired sessions from tempdb.

Recall that ASP.NET does not keep session resources
alive indefinitely. To support this feature when a SQL Server
is used to maintain state, the SQL Server Agent must be running
so that the expired session deletion job runs as needed.

By default, the job is scheduled to run every minute. It deletes
session state rows with an Expires value less than the current time.

The account under which the SQL Server Agent runs must have the
privilege to execute the DeleteExpiredSessions stored procedure."

---000---

If SQL Server Agent isn't running,
The DeleteExpiredSessions job can't run.

I hope that's it!



Juan T. Llibre
===========
"Tim W." <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> Folks.
>
> In a B2B Procurement system we've created, we got following Session-Issue:
>
> Configuration: We are using IIS 6.0 and added SQL-Based-Sessions in
> web.config with a timeout of 240 minutes and set them to cookieless mode.
> As well we added Session.Timeout=240 in asp.net-application and saved data
> into the session.
>
> Session-Timeout in IIS is also set to 240.
>
> When looking at the ASPStateTempSessions table, we can see Expires field
> which has the correct expirery-value.
>
> Problem: We don't ever get any timeout. Session seems to be still alive
> after 14 hours. If we call session with session-id in url, we get all
> values we set before out of the session.
>
> As well we tried to set session-timeout to 1minute, but same thing
> happened (in application and IIS and web.config) Also we tried to disable
> Session-State in IIS. But everytime the same result: Session gets not
> destroyed (Session.Abandon()) after expirery-time passed.
>
> Did we overlook something? What keeps the session alive?
>
> Thanks for help in advance,
>
> Tim ((E-Mail Removed))
>




 
Reply With Quote
 
 
 
 
Tim W.
Guest
Posts: n/a
 
      12-19-2004
Hi Juan,

first checked whether Agent is running: it is! Nonetheless: I don't think
ASPStats_Job_DeleteExpiredSessions is registered. How can I make sure,
and is there a way to setup this job other than re-installing the whole IIS?

Tim

"Juan T. Llibre [MVP]" <(E-Mail Removed)> schrieb im Newsbeitrag
news:e4$(E-Mail Removed)...
> Is SQL Server Agent running ?
>
> See http://www.dbazine.com/cook9.shtml
>
> "The InstallSqlState.sql script creates a job called
> ASPState_Job_DeleteExpiredSessions to delete
> expired sessions from tempdb.
>
> Recall that ASP.NET does not keep session resources
> alive indefinitely. To support this feature when a SQL Server
> is used to maintain state, the SQL Server Agent must be running
> so that the expired session deletion job runs as needed.
>
> By default, the job is scheduled to run every minute. It deletes
> session state rows with an Expires value less than the current time.
>
> The account under which the SQL Server Agent runs must have the
> privilege to execute the DeleteExpiredSessions stored procedure."
>
> ---000---
>
> If SQL Server Agent isn't running,
> The DeleteExpiredSessions job can't run.
>
> I hope that's it!
>
>
>
> Juan T. Llibre
> ===========
> "Tim W." <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
>> Folks.
>>
>> In a B2B Procurement system we've created, we got following
>> Session-Issue:
>>
>> Configuration: We are using IIS 6.0 and added SQL-Based-Sessions in
>> web.config with a timeout of 240 minutes and set them to cookieless mode.
>> As well we added Session.Timeout=240 in asp.net-application and saved
>> data
>> into the session.
>>
>> Session-Timeout in IIS is also set to 240.
>>
>> When looking at the ASPStateTempSessions table, we can see Expires field
>> which has the correct expirery-value.
>>
>> Problem: We don't ever get any timeout. Session seems to be still alive
>> after 14 hours. If we call session with session-id in url, we get all
>> values we set before out of the session.
>>
>> As well we tried to set session-timeout to 1minute, but same thing
>> happened (in application and IIS and web.config) Also we tried to disable
>> Session-State in IIS. But everytime the same result: Session gets not
>> destroyed (Session.Abandon()) after expirery-time passed.
>>
>> Did we overlook something? What keeps the session alive?
>>
>> Thanks for help in advance,
>>
>> Tim ((E-Mail Removed))
>>

>
>
>



 
Reply With Quote
 
bjc
Guest
Posts: n/a
 
      12-20-2004
Hi Tim - Does your code close all data connections (duh)? Try setting
everything that has anything to do with data or a recordsets to null.


"Tim W." <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> Hi Juan,
>
> first checked whether Agent is running: it is! Nonetheless: I don't think
> ASPStats_Job_DeleteExpiredSessions is registered. How can I make sure,
> and is there a way to setup this job other than re-installing the whole

IIS?
>
> Tim
>
> "Juan T. Llibre [MVP]" <(E-Mail Removed)> schrieb im Newsbeitrag
> news:e4$(E-Mail Removed)...
> > Is SQL Server Agent running ?
> >
> > See http://www.dbazine.com/cook9.shtml
> >
> > "The InstallSqlState.sql script creates a job called
> > ASPState_Job_DeleteExpiredSessions to delete
> > expired sessions from tempdb.
> >
> > Recall that ASP.NET does not keep session resources
> > alive indefinitely. To support this feature when a SQL Server
> > is used to maintain state, the SQL Server Agent must be running
> > so that the expired session deletion job runs as needed.
> >
> > By default, the job is scheduled to run every minute. It deletes
> > session state rows with an Expires value less than the current time.
> >
> > The account under which the SQL Server Agent runs must have the
> > privilege to execute the DeleteExpiredSessions stored procedure."
> >
> > ---000---
> >
> > If SQL Server Agent isn't running,
> > The DeleteExpiredSessions job can't run.
> >
> > I hope that's it!
> >
> >
> >
> > Juan T. Llibre
> > ===========
> > "Tim W." <(E-Mail Removed)> wrote in message
> > news:%(E-Mail Removed)...
> >> Folks.
> >>
> >> In a B2B Procurement system we've created, we got following
> >> Session-Issue:
> >>
> >> Configuration: We are using IIS 6.0 and added SQL-Based-Sessions in
> >> web.config with a timeout of 240 minutes and set them to cookieless

mode.
> >> As well we added Session.Timeout=240 in asp.net-application and saved
> >> data
> >> into the session.
> >>
> >> Session-Timeout in IIS is also set to 240.
> >>
> >> When looking at the ASPStateTempSessions table, we can see Expires

field
> >> which has the correct expirery-value.
> >>
> >> Problem: We don't ever get any timeout. Session seems to be still alive
> >> after 14 hours. If we call session with session-id in url, we get all
> >> values we set before out of the session.
> >>
> >> As well we tried to set session-timeout to 1minute, but same thing
> >> happened (in application and IIS and web.config) Also we tried to

disable
> >> Session-State in IIS. But everytime the same result: Session gets not
> >> destroyed (Session.Abandon()) after expirery-time passed.
> >>
> >> Did we overlook something? What keeps the session alive?
> >>
> >> Thanks for help in advance,
> >>
> >> Tim ((E-Mail Removed))
> >>

> >
> >
> >

>
>



 
Reply With Quote
 
Steven Cheng[MSFT]
Guest
Posts: n/a
 
      12-20-2004
Hi Tim,

I think Juan's suggestion is correct. To enable the SQLserver's auto
deleting on expired session item, we need to ensure that the SQL Agent is
running. In addition, based on my test, When we start a IE browser instance
to visist a sqlserver session app's page, the session will always remain
the same no matter it has been timeout during the post backs or not. But
this doesn't means that the session record in the SqlServer will alwasy
remain, in fact, the record in the sqlserver will be deleted correctly when
it is expired. You can make a simple page( in a sql session webapp with
timeout = 1 min). You'll found the certain session record will be deleted
from the database after timeout timespan, but when you request the page
again, a new record is created, and the displaying SessionId in asp.net is
still the same.

Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

 
Reply With Quote
 
Juan T. Llibre [MVP]
Guest
Posts: n/a
 
      12-20-2004
Hi, Tim.

Reinstalling IIS is not needed.

What you need to do is make sure that the
DeleteExpiredSessions stored procedure
is run by a SQL Server Agent as a job.

The InstallSqlState.sql script should have created the
job called ASPState_Job_DeleteExpiredSessions.

If, for any reason at all, that didn't happen,
look for InstallSqlState.sql in the .
%windir%\Microsoft.Net\Framework\v1.1.4322 directory,
if you're using .Net Framework 1.1, or the appropiate
version number directory if using a different version.

If you don't have critical data yet, it probably would be
easier to drop the whole shebang by running the
"UninstallSqlState.sql" script found in the same directory,
and then reinstalling it by running InstallSqlState.sql again
( using SQL Server Query Analyzer for both ).

Then, make sure that SQL Server Agent
is run automatically when Windows starts
( Administrative Tools -> Services, look for SQL Server Agent,
and set to automatic startup )

That should get you up and running.

Let us know how you make out.

I will not be available after tomorrow ( 2 week vacation ),
but there's any number of good people here who can help.



Juan T. Llibre
===========
"Tim W." <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> Hi Juan,
>
> first checked whether Agent is running: it is! Nonetheless: I don't think
> ASPStats_Job_DeleteExpiredSessions is registered. How can I make sure,
> and is there a way to setup this job other than re-installing the whole
> IIS?
>
> Tim
>
> "Juan T. Llibre [MVP]" <(E-Mail Removed)> schrieb im Newsbeitrag
> news:e4$(E-Mail Removed)...
>> Is SQL Server Agent running ?
>>
>> See http://www.dbazine.com/cook9.shtml
>>
>> "The InstallSqlState.sql script creates a job called
>> ASPState_Job_DeleteExpiredSessions to delete
>> expired sessions from tempdb.
>>
>> Recall that ASP.NET does not keep session resources
>> alive indefinitely. To support this feature when a SQL Server
>> is used to maintain state, the SQL Server Agent must be running
>> so that the expired session deletion job runs as needed.
>>
>> By default, the job is scheduled to run every minute. It deletes
>> session state rows with an Expires value less than the current time.
>>
>> The account under which the SQL Server Agent runs must have the
>> privilege to execute the DeleteExpiredSessions stored procedure."
>>
>> ---000---
>>
>> If SQL Server Agent isn't running,
>> The DeleteExpiredSessions job can't run.
>>
>> I hope that's it!
>>
>>
>>
>> Juan T. Llibre
>> ===========
>> "Tim W." <(E-Mail Removed)> wrote in message
>> news:%(E-Mail Removed)...
>>> Folks.
>>>
>>> In a B2B Procurement system we've created, we got following
>>> Session-Issue:
>>>
>>> Configuration: We are using IIS 6.0 and added SQL-Based-Sessions in
>>> web.config with a timeout of 240 minutes and set them to cookieless
>>> mode.
>>> As well we added Session.Timeout=240 in asp.net-application and saved
>>> data
>>> into the session.
>>>
>>> Session-Timeout in IIS is also set to 240.
>>>
>>> When looking at the ASPStateTempSessions table, we can see Expires field
>>> which has the correct expirery-value.
>>>
>>> Problem: We don't ever get any timeout. Session seems to be still alive
>>> after 14 hours. If we call session with session-id in url, we get all
>>> values we set before out of the session.
>>>
>>> As well we tried to set session-timeout to 1minute, but same thing
>>> happened (in application and IIS and web.config) Also we tried to
>>> disable
>>> Session-State in IIS. But everytime the same result: Session gets not
>>> destroyed (Session.Abandon()) after expirery-time passed.
>>>
>>> Did we overlook something? What keeps the session alive?
>>>
>>> Thanks for help in advance,
>>>
>>> Tim ((E-Mail Removed))
>>>

>>
>>
>>

>
>



 
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
Session Timeout problems-web.confg session state and IIS session s =?Utf-8?B?Um9iSEs=?= ASP .Net 4 04-11-2007 04:52 PM
XML Schema never-never occurence of declared elements / attributes Soren Kuula XML 1 12-01-2005 01:27 PM
Timeout::timeout and Socket timeout Mark Probert Ruby 1 10-06-2004 09:30 AM
Session contents lost despite Session.Timeout = 3000; and <sessionState mode="InProc" cookieless="false" timeout="300"> Carpe Diem ASP .Net 3 02-23-2004 07:10 PM
string routines go to never never land on unix Kevin C Programming 4 10-17-2003 06:07 PM



Advertisments