Do not update Session timeout

J

Jon Booth

I want to write an apsx page that when loaded does not refresh
Session.Timeout.
It is going to be running in an iframe and refreshing every couple of
minutes.

example. User has 15 minutes left until session expires. iframe.aspx loads
and session still has 15 minutes left.

Is this possible?
I was trying to grab session.timeout at the begininning of the page (init)
and then resetting it back to that value at the end, but session.timeout
always = 20

Thanks
Jon
 
A

Alvin Bruney

i'm not really understanding what you want to do here. resetting the session
time out to another value will cause the timeout to change. Are you wanting
to turn off the timeout? what problems are you having? some code would help
 
M

Martin

I want to write an apsx page that when loaded does not refresh
i'm not really understanding what you want to do here.

It took me a while too but I think I understand what he is after. He wants
to make a sneeky request that does not prolong the session's lifetime. He
probably wants to achieve something the wrong way.

No. You'd better tell what you really want, there is probably a right way to
get there instead of using session timeout. You may already be using session
timeout for the wrong purposes. Do you want to track users beyond a certain
page? You may want to use authentication for that instead. Think of session
as something ASP.NET uses for keeping track of browser instances. Tracking
users is something different that you will be doing independently from
sessions.

Martin.
 
J

Jon Booth

Hi guys,
Sorry for the confusion.
In all the pages on my site I have a little iframe that updates every 2
minutes, displaying a little message (similar to breaking news etc). Because
each time this page updates the session.timeout got reset the user's session
never expired. I was hoping there was a way to stop the session.timeout from
being reset. This is not possible.

I have created a workaround by holding in a session datetime.now from the
main page and checking in the message iframe if this is more than 20 minutes
then killing the session. This suits my needs.

Thanks for your time.
 
M

Martin

I have created a workaround by holding in a session datetime.now from the
main page and checking in the message iframe if this is more than 20 minutes
then killing the session. This suits my needs.

Well that's not very nice on the visitor of your site. If he stays around
for more than 20 minutes he will find his session killed while in the middle
of doing something interactive. Of course you get away with it if your site
is stateless anyway of doesn't depend on the session object.

Martin
 
H

Hans Kesting

Jon Booth said:
I want to write an apsx page that when loaded does not refresh
Session.Timeout.
It is going to be running in an iframe and refreshing every couple of
minutes.

example. User has 15 minutes left until session expires. iframe.aspx loads
and session still has 15 minutes left.

Is this possible?
I was trying to grab session.timeout at the begininning of the page (init)
and then resetting it back to that value at the end, but session.timeout
always = 20

Thanks
Jon

Could you put that "iframe page" in a special directory of your site, where
you also have a new web.config that switches session management off for
this directory?
I have never tried this, but if it works then you wouldn't get sessions for
that particular page (or rather, for that part of the directory tree), so it
shouldn't interfere with the sessions in the rest of the site.

Let us know how this approach works!

Hans Kesting
 

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

Similar Threads

Session timeout 2
Session Timeout, not working 2
Session Timeout 1
Code sharing 2
Session Timeout 13
Session Timeout pt deux 2
session timeout problem 1
timeout... session + forms authentication 2

Members online

No members online now.

Forum statistics

Threads
474,262
Messages
2,571,058
Members
48,769
Latest member
Clifft

Latest Threads

Top