sessionstate = SQLServer

W

Wardeaux

I'm wanting to use SQL to store session variables. This works well because
it maintains session variables even though a session times out but the
browser is still open
When a session.entry in the sql table ASPStateTempSessions is automatically
removed whenever the browser calls "Session.Abandon"... this is good, but
the session entry is left when the browser is closed by the user thus ending
the session. How do the entries eventually get cleaned up in the
ASPStateTempSessions table? I can't just have them accumulating over the
years...

anyone use this feature before and has a solution?

MTIA
wardeaux
 
J

Joris Dobbelsteen

Use the Session_End (or simulair) event. I don't know whether its called
always, but it should be...

Additionally you can add a date to the table when it was last updated and
periodically scrave the database for really old data (which should exist
anyway).
You can use this mechanism to check whether the application actually does
its job.

- Joris
 
P

Patrice

AFAIK you should have a SQL Job that cleans up old data. Double check the
SQL scripts...

Patrice
 
W

Wardeaux

Patrice,
Thanks for the reply... I see a script "DeleteExpiredSessions" in the
ASPState db... does this get run automagically (if so... when) or do I need
to run/schedule this (if so... how)?
I'm only lightly familiar with SQL so any help is GREATLY appreciated! :)
MTIA
wardeaux
BTW, I'm not familiar with "AFAIK", what does that stand for?
 
B

bruce barker

generally its scheduled with SQLAgent. use sql enterprise manager under
magament->sql server agent ->jobs you should find the sp scheduled to run.
if not add it.

-- bruce (sqlwork.com)
 
M

M. Posseth

if you executed the SQL file as described in the documentation (MSDN or
70-305 / 70-315) the sql server agent wil start a clean job for expired
sessions
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top