By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,950 Members | 1,585 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,950 IT Pros & Developers. It's quick & easy.

Session Expiration in ASP.NET

P: n/a
Hi guys

How can I make the session in an ASP.NET application so that it NEVER
EXPIRES ?

thanks

Nov 19 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Store your session data in the database.

Surely you would not want your session to hang around longer than one day,
and in that case just set the <sessionState timeout="..." number of minutes
to however many you need for the day (eg. 8 * 60 for 8 hour day). Its a long
time to hold onto data though, especially if using in memory session store,
hence why I suggested the database. Store it there, get it when you need it.

--

- Paul Glavich
ASP.NET MVP
ASPInsider (www.aspinsiders.com)
"Snig" <sn****@yahoo.co.in> wrote in message
news:11*********************@z14g2000cwz.googlegro ups.com...
Hi guys

How can I make the session in an ASP.NET application so that it NEVER
EXPIRES ?

thanks

Nov 19 '05 #2

P: n/a
Thanks Paul.
But, is there any way to configure it is such a way that the session is
stored in memory (InProc) and still it never expires ?

Nov 19 '05 #3

P: n/a
Given that Inproc sessionState management implies that the
ASP.NET worker process *will* recycle every so often,
there's no way to configure it so that a session never expires.

Sessions *will* expire when the worker process recycles,
if you're using InProc sessionState management.


Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
======================

"Snig" <sn****@yahoo.co.in> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
Thanks Paul.
But, is there any way to configure it is such a way that the session is
stored in memory (InProc) and still it never expires ?

Nov 19 '05 #4

P: n/a
Snig wrote:
Hi guys

How can I make the session in an ASP.NET application so that it NEVER
EXPIRES ?

thanks


I don't think you want that. If a user opens an other instance of his
browser, he gets a new session. If a session never expires, then data
from that session would hang around (=take up precious memory)
"forever". There is no way to go "back" to such an abandoned session.
The session doesn't automatically vanish when the user "navigates away"
or "closes his browser".

What you might want is a way to keep the session alive as long as that
user displays a page of your site. You could do that by refreshing that
page often enough (automatically: see <meta http-equiv=refresh>) to beat
the session timeout. Maybe you could refresh a special page that is
displayed in an iframe in some corner of your screen, if you don't want
to refresh the entire screen.
--
Hans Kesting
Nov 19 '05 #5

P: n/a
Snig wrote:
Hi guys

How can I make the session in an ASP.NET application so that it NEVER
EXPIRES ?

thanks


I don't think you want that. If a user opens an other instance of his
browser, he gets a new session. If a session never expires, then data
from that session would hang around (=take up precious memory)
"forever". There is no way to go "back" to such an abandoned session.
The session doesn't automatically vanish when the user "navigates away"
or "closes his browser".

What you might want is a way to keep the session alive as long as that
user displays a page of your site. You could do that by refreshing that
page often enough (automatically: see <meta http-equiv=refresh>) to beat
the session timeout. Maybe you could refresh a special page that is
displayed in an iframe in some corner of your screen, if you don't want
to refresh the entire screen.
--
Hans Kesting
Nov 19 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.