Showing posts with label timeouts. Show all posts
Showing posts with label timeouts. Show all posts

Saturday, March 31, 2012

Session timeouts

how can i disable session timeouts without affecting any program codings?You do NOT want to disable Session timeouts. Sessions time out for a very
good reason: Every time a user logs onto your site, a Session is created. If
you disabled their timeout, you would in essence, create a memory leak that
would take very little time to crash your application. What you SHOULD do is
handle Session timeouts effectively.
HTH,
Kevin Spencer
Microsoft MVP
.Net Developer
The sun never sets on
the Kingdom of Heaven
"Fraijo" <Fraijo@.discussions.microsoft.com> wrote in message
news:FAE5CDD2-A0DF-451A-92E5-F7DCDA5F4953@.microsoft.com...
> how can i disable session timeouts without affecting any program codings?

Session timeouts

Hi
I've just been told that closing your browser closes your session on the
web-site you are viewing, is this true? If so, is this the browser that init
iates
the closure, or the server?
Thanks
Kev"Mantorok" <spamthis@.spam.com> wrote in message
news:cbc5da882bbc88c8422cf73e68ca@.news.rmplc.co.uk...

> I've just been told that closing your browser closes your session on the
> web-site you are viewing, is this true?
Totally untrue. If you want to make sure that a session is closed, you need
to provide a mechanism for a user to initiate it i.e. some sort of "Log out"
facility which tears down the session. The server is simply waiting to
respond to requests from clients - it cannot know when a browser has been
closed.
Do a Google search - this topic has been discussed ad nauseum...
http://www.thescripts.com/forum/thread321607.html
"Mark Rae" <mark@.markN-O-S-P-A-M.co.uk> wrote in message
news:OjkCr%23AdGHA.4276@.TK2MSFTNGP03.phx.gbl...
> "Mantorok" <spamthis@.spam.com> wrote in message
> news:cbc5da882bbc88c8422cf73e68ca@.news.rmplc.co.uk...
>
> Totally untrue. If you want to make sure that a session is closed, you
> need to provide a mechanism for a user to initiate it i.e. some sort of
> "Log out" facility which tears down the session. The server is simply
> waiting to respond to requests from clients - it cannot know when a
> browser has been closed.
Thank you for clarifying my thoughts, when I first heard it I immediately
said "How does the server know the client closed the browser?", silenced
followed.....
Cheers
Kev
"Mark Rae" <mark@.markN-O-S-P-A-M.co.uk> wrote in message
news:OjkCr%23AdGHA.4276@.TK2MSFTNGP03.phx.gbl...
> "Mantorok" <spamthis@.spam.com> wrote in message
> news:cbc5da882bbc88c8422cf73e68ca@.news.rmplc.co.uk...
>
> Totally untrue. If you want to make sure that a session is closed, you
> need to provide a mechanism for a user to initiate it i.e. some sort of
> "Log out" facility which tears down the session. The server is simply
> waiting to respond to requests from clients - it cannot know when a
> browser has been closed.
Come to think of it - when I log in to my (internal) web-site it stores my
login in a session variable, however when I close the browser and re-open my
login session has gone.
What's happening here?
Thanks
Kev
"Mantorok" <mantorok@.mantorok.com> wrote in message
news:e3sbfk$6br$1@.newsfeed.th.ifl.net...

> Come to think of it - when I log in to my (internal) web-site it stores my
> login in a session variable, however when I close the browser and re-open
> my login session has gone.
> What's happening here?
Opening the browser again causes a new session to be created.
"Mark Rae" <mark@.markN-O-S-P-A-M.co.uk> wrote in message
news:Oy$AtTBdGHA.4912@.TK2MSFTNGP05.phx.gbl...
> "Mantorok" <mantorok@.mantorok.com> wrote in message
> news:e3sbfk$6br$1@.newsfeed.th.ifl.net...
>
> Opening the browser again causes a new session to be created.
Aha, thanks.
Kev
"Mantorok" <mantorok@.mantorok.com> wrote in message
news:e3scup$71j$1@.newsfeed.th.ifl.net...

> Aha, thanks.
http://www.google.com/search?source...22+IsNewSession
Covering a few items in this thread:
Closing your browser does nothing on the server. The server still waits
until timeout to get rid of the session. And, opening a browser creates a
new session. This means you now have two sessions, but you are only
connected to the newest session.
The way this works is through a session cookie, or server cookie. Even users
with normal cookies off can get these. There are some older browsers that
see both types of cookies as the same. And, yes, an industrious user can
refuse server cookies, as well. But it is rare.
When you open the browser, it will not reuse a server cookie, even if the
session has not timed out. This is for security purposes. So, it creates a
new connection and gets a new server cookie (session). If you open and close
the browser 100 times, you have 100 sessions until they time out, but you
cannot get to any for which you have closed the browser.
Another interesting topic. If you open a new browser instance using Control
+ N, both connect to the same session. If you use the menu, you have two
different sessions. Cool, eh?
Remember, the web is stateless, so it has no clue what the user is doing.
Gregory A. Beamer
****************************************
*********
Think Outside the Box!
****************************************
*********
"Mantorok" <spamthis@.spam.com> wrote in message
news:cbc5da882bbc88c8422cf73e68ca@.news.rmplc.co.uk...
> Hi
> I've just been told that closing your browser closes your session on the
> web-site you are viewing, is this true? If so, is this the browser that
> initiates the closure, or the server?
> Thanks
> Kev
>
Cowboy,
Very good.
How? an industrious user can
refuse server cookies, as well. But it is rare.
more details please thanks for the education
SA
"Cowboy (Gregory A. Beamer)" <NoSpamMgbworld@.comcast.netNoSpamM> wrote in
message news:eeghAWCdGHA.5048@.TK2MSFTNGP04.phx.gbl...
> Covering a few items in this thread:
> Closing your browser does nothing on the server. The server still waits
> until timeout to get rid of the session. And, opening a browser creates a
> new session. This means you now have two sessions, but you are only
> connected to the newest session.
> The way this works is through a session cookie, or server cookie. Even
> users with normal cookies off can get these. There are some older browsers
> that see both types of cookies as the same. And, yes, an industrious user
> can refuse server cookies, as well. But it is rare.
> When you open the browser, it will not reuse a server cookie, even if the
> session has not timed out. This is for security purposes. So, it creates a
> new connection and gets a new server cookie (session). If you open and
> close the browser 100 times, you have 100 sessions until they time out,
> but you cannot get to any for which you have closed the browser.
> Another interesting topic. If you open a new browser instance using
> Control + N, both connect to the same session. If you use the menu, you
> have two different sessions. Cool, eh?
> Remember, the web is stateless, so it has no clue what the user is doing.
> --
> Gregory A. Beamer
> ****************************************
*********
> Think Outside the Box!
> ****************************************
*********
> "Mantorok" <spamthis@.spam.com> wrote in message
> news:cbc5da882bbc88c8422cf73e68ca@.news.rmplc.co.uk...
>

Session Timeouts

H, I have noticed that when the session has timed out, and you refresh the
pag etc, you very often end up with debug messages etc. Is there any clean
way to handle this so the users will not see the stack trace ?
I know there is the option to turn on the friendly messages, will this do
the trick >?
Cheers
Best Regards
The Inimitable Mr NewbieWhat's the debug message? Is it because the code is assuming Session is vali
d
even though it's not? I suspect that might be the problem...
In any event, if you don't want your users to see unhandled exception inform
ation,
consider setting up an error redirect page via the <customErrors> element
in web.config.
http://msdn.microsoft.com/library/d...rorsSection.asp
-Brock
DevelopMentor
http://staff.develop.com/ballen

> H, I have noticed that when the session has timed out, and you refresh
> the pag etc, you very often end up with debug messages etc. Is there
> any clean way to handle this so the users will not see the stack trace
> ?
> I know there is the option to turn on the friendly messages, will this
> do the trick >?
> Cheers
> The Inimitable Mr Newbie
>

Session Timeout?

Hello,
is there any possibility to do something when the
session timeouts via code not via the global.asax?
ThanksWhat do you mean, the global.asax is code.
"Vishal" <anonymous@.discussions.microsoft.com> wrote in message
news:0bba01c4f996$cb277d70$a401280a@.phx.gbl...
> Hello,
> is there any possibility to do something when the
> session timeouts via code not via the global.asax?
> Thanks
No.
You can only execute code,
when Session_OnEnd fires, via global.asax
Juan T. Llibre
ASP.NET MVP
===========
"Vishal" <anonymous@.discussions.microsoft.com> wrote in message
news:0bba01c4f996$cb277d70$a401280a@.phx.gbl...
> Hello,
> is there any possibility to do something when the
> session timeouts via code not via the global.asax?
> Thanks
The Global.asax can only run, when I make the folder an
IIS application right? Is it possible to run the
Global.asax without making the folder an IIS application?
Thanks so far.

>--Original Message--
>No.
>You can only execute code,
>when Session_OnEnd fires, via global.asax
>
>Juan T. Llibre
>ASP.NET MVP
>===========
>"Vishal" <anonymous@.discussions.microsoft.com> wrote in
message
>news:0bba01c4f996$cb277d70$a401280a@.phx.gbl...
>
>.
>
Again, no.
Global.asax will not execute unless the folder
is at least a virtual directory, or an application.
Juan T. Llibre
ASP.NET MVP
===========
"Vishal" <anonymous@.discussions.microsoft.com> wrote in message
news:090601c4f9a5$b5b71090$a301280a@.phx.gbl...
> The Global.asax can only run, when I make the folder an
> IIS application right? Is it possible to run the
> Global.asax without making the folder an IIS application?
> Thanks so far.
>
> message

Session Timeout?

Hello,

is there any possibility to do something when the
session timeouts via code not via the global.asax?

ThanksWhat do you mean, the global.asax is code.

"Vishal" <anonymous@.discussions.microsoft.com> wrote in message
news:0bba01c4f996$cb277d70$a401280a@.phx.gbl...
> Hello,
> is there any possibility to do something when the
> session timeouts via code not via the global.asax?
> Thanks
No.

You can only execute code,
when Session_OnEnd fires, via global.asax

Juan T. Llibre
ASP.NET MVP
===========
"Vishal" <anonymous@.discussions.microsoft.com> wrote in message
news:0bba01c4f996$cb277d70$a401280a@.phx.gbl...
> Hello,
> is there any possibility to do something when the
> session timeouts via code not via the global.asax?
> Thanks
The Global.asax can only run, when I make the folder an
IIS application right? Is it possible to run the
Global.asax without making the folder an IIS application?

Thanks so far.

>--Original Message--
>No.
>You can only execute code,
>when Session_OnEnd fires, via global.asax
>
>Juan T. Llibre
>ASP.NET MVP
>===========
>"Vishal" <anonymous@.discussions.microsoft.com> wrote in
message
>news:0bba01c4f996$cb277d70$a401280a@.phx.gbl...
>> Hello,
>>
>> is there any possibility to do something when the
>> session timeouts via code not via the global.asax?
>>
>> Thanks
>
>.
Again, no.

Global.asax will not execute unless the folder
is at least a virtual directory, or an application.

Juan T. Llibre
ASP.NET MVP
===========
"Vishal" <anonymous@.discussions.microsoft.com> wrote in message
news:090601c4f9a5$b5b71090$a301280a@.phx.gbl...
> The Global.asax can only run, when I make the folder an
> IIS application right? Is it possible to run the
> Global.asax without making the folder an IIS application?
> Thanks so far.
>>--Original Message--
>>No.
>>
>>You can only execute code,
>>when Session_OnEnd fires, via global.asax
>>
>>
>>
>>Juan T. Llibre
>>ASP.NET MVP
>>===========
>>"Vishal" <anonymous@.discussions.microsoft.com> wrote in
> message
>>news:0bba01c4f996$cb277d70$a401280a@.phx.gbl...
>>> Hello,
>>>
>>> is there any possibility to do something when the
>>> session timeouts via code not via the global.asax?
>>>
>>> Thanks
>>
>>
>>.
>

Session Timeouts

Which Session Timeout property is used by default.
Is it the one in IIS (900 seconds)
Machine.config (20 mins)
or
Web.config (20 mins)
Could someone explain how this works.
Or is it IIS just because that ends first?
Thanksasp.net does not use the IIS session - these are for classic asp
true session timeout only occurs with the inproc session manager running in
your app domain. for its configuration it defaults to machine.config, but
web.config overrides it , like all settings (unless overriding
machine.config has been disabled).
-- bruce (sqlwork.com)
"BillGatesFan" <klj_mcsd@.hotmail.com> wrote in message
news:1103664141.963104.39250@.z14g2000cwz.googlegroups.com...
| Which Session Timeout property is used by default.
|
| Is it the one in IIS (900 seconds)
|
| Machine.config (20 mins)
|
| or
|
| Web.config (20 mins)
|
| Could someone explain how this works.
| Or is it IIS just because that ends first?
|
| Thanks
|
BillGatesFan..
I have also asked this question once..
But after my research..i think Web.Config..overrides all of them.
Patrick
*** Sent via Developersdex http://www.examnotes.net ***
Don't just participate in USENET...get rewarded for it!

Session Timeouts

I have developed an asp.net 2.0 app on my instance of server2003 and have
set IIS to timout in 40 minutes (asp.net|configuration) and it works just
fine - the app won't timeout until 40 minutes of inactivity passes.
However when deployed to a production server2003 machine with the very same
IIS settings, the app times out in 20 minutes. I have no specific timeout
statement either in code or web.config.
Any ideas?
Regards,
Gary BlakelyOn May 25, 6:48 am, "GaryDean" <GaryD...@.newsgroups.nospam> wrote:
> I have developed an asp.net 2.0 app on my instance of server2003 and have
> set IIS to timout in 40 minutes (asp.net|configuration) and it works just
> fine - the app won't timeout until 40 minutes of inactivity passes.
> However when deployed to a production server2003 machine with the very sam
e
> IIS settings, the app times out in 20 minutes. I have no specific timeout
> statement either in code or web.config.
> Any ideas?
> --
> Regards,
> Gary Blakely
Hi Gary...
20 min is a default timeout period...
please add timeout configuration in web.config and set it to 40 min...
if this problem still remains please check your machine.config
file...
Thanks
Masudur
I guess I failed to say that I have tried all of the obvious solutions, some
of which, you suggest.
Regards,
Gary Blakely
"Masudur" <munnacs@.gmail.com> wrote in message
news:1180069599.240101.129060@.g4g2000hsf.googlegroups.com...
> On May 25, 6:48 am, "GaryDean" <GaryD...@.newsgroups.nospam> wrote:
> Hi Gary...
> 20 min is a default timeout period...
> please add timeout configuration in web.config and set it to 40 min...
> if this problem still remains please check your machine.config
> file...
> Thanks
> Masudur
>
On May 27, 6:53 pm, "GaryDean" <GaryD...@.newsgroups.nospam> wrote:
> I guess I failed to say that I have tried all of the obvious solutions, so
me
> of which, you suggest.
>
So, did you tried to set timeout in the web.config file?
<sessionState mode="InProc"
cookieless="true"
timeout="40"/>
Hi Gary,
This issue does look strange, if you're pretty sure that the obvious
web.config settings and IIS settings are correctly configured:
1) web.config, see Alexey's suggestion.
2) IIS: virtual directory properties -> (Directory) Configuration ->
(Options) "Session timeout".
Maybe we're lack of some context or background information, would you
please depict more on the other configuration settings your web site
having? Thanks.
Regards,
Walter Wang (wawang@.online.microsoft.com, remove 'online.')
Microsoft Online Community Support
========================================
==========
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
========================================
==========
This posting is provided "AS IS" with no warranties, and confers no rights.
Walter,
Is there some reason cookieless="true" has to be coupled with the timeout
setting?
BTW, are there any downsides to cookieless sessions other than having the
sessionID in the url?
Regards,
Gary Blakely
"Walter Wang [MSFT]" <wawang@.online.microsoft.com> wrote in message
news:3X3TzCZoHHA.1144@.TK2MSFTNGHUB02.phx.gbl...
> Hi Gary,
> This issue does look strange, if you're pretty sure that the obvious
> web.config settings and IIS settings are correctly configured:
> 1) web.config, see Alexey's suggestion.
> 2) IIS: virtual directory properties -> (Directory) Configuration ->
> (Options) "Session timeout".
>
> Maybe we're lack of some context or background information, would you
> please depict more on the other configuration settings your web site
> having? Thanks.
>
> Regards,
> Walter Wang (wawang@.online.microsoft.com, remove 'online.')
> Microsoft Online Community Support
> ========================================
==========
> When responding to posts, please "Reply to Group" via your newsreader so
> that others may learn and benefit from your issue.
> ========================================
==========
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
>
also, this is a little strange...
if iis is set to 20 and my web.config says timeout="40" at 22 minutes of no
activity the user does not get the login screen, the session variables are
just null.
Regards,
Gary Blakely
"Walter Wang [MSFT]" <wawang@.online.microsoft.com> wrote in message
news:3X3TzCZoHHA.1144@.TK2MSFTNGHUB02.phx.gbl...
> Hi Gary,
> This issue does look strange, if you're pretty sure that the obvious
> web.config settings and IIS settings are correctly configured:
> 1) web.config, see Alexey's suggestion.
> 2) IIS: virtual directory properties -> (Directory) Configuration ->
> (Options) "Session timeout".
>
> Maybe we're lack of some context or background information, would you
> please depict more on the other configuration settings your web site
> having? Thanks.
>
> Regards,
> Walter Wang (wawang@.online.microsoft.com, remove 'online.')
> Microsoft Online Community Support
> ========================================
==========
> When responding to posts, please "Reply to Group" via your newsreader so
> that others may learn and benefit from your issue.
> ========================================
==========
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
>
I have new information and I am going to start a new thread on this
Regards,
Gary Blakely
"Walter Wang [MSFT]" <wawang@.online.microsoft.com> wrote in message
news:3X3TzCZoHHA.1144@.TK2MSFTNGHUB02.phx.gbl...
> Hi Gary,
> This issue does look strange, if you're pretty sure that the obvious
> web.config settings and IIS settings are correctly configured:
> 1) web.config, see Alexey's suggestion.
> 2) IIS: virtual directory properties -> (Directory) Configuration ->
> (Options) "Session timeout".
>
> Maybe we're lack of some context or background information, would you
> please depict more on the other configuration settings your web site
> having? Thanks.
>
> Regards,
> Walter Wang (wawang@.online.microsoft.com, remove 'online.')
> Microsoft Online Community Support
> ========================================
==========
> When responding to posts, please "Reply to Group" via your newsreader so
> that others may learn and benefit from your issue.
> ========================================
==========
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
>

Session Timeouts

Which Session Timeout property is used by default.

Is it the one in IIS (900 seconds)

Machine.config (20 mins)

or

Web.config (20 mins)

Could someone explain how this works.
Or is it IIS just because that ends first?

Thanksasp.net does not use the IIS session - these are for classic asp

true session timeout only occurs with the inproc session manager running in
your app domain. for its configuration it defaults to machine.config, but
web.config overrides it , like all settings (unless overriding
machine.config has been disabled).

-- bruce (sqlwork.com)

"BillGatesFan" <klj_mcsd@.hotmail.com> wrote in message
news:1103664141.963104.39250@.z14g2000cwz.googlegro ups.com...
| Which Session Timeout property is used by default.
|
| Is it the one in IIS (900 seconds)
|
| Machine.config (20 mins)
|
| or
|
| Web.config (20 mins)
|
| Could someone explain how this works.
| Or is it IIS just because that ends first?
|
| Thanks
|
BillGatesFan..
I have also asked this question once..
But after my research..i think Web.Config..overrides all of them.
Patrick

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Session Timeouts

H, I have noticed that when the session has timed out, and you refresh the
pag etc, you very often end up with debug messages etc. Is there any clean
way to handle this so the users will not see the stack trace ?

I know there is the option to turn on the friendly messages, will this do
the trick >?

Cheers

--
Best Regards

The Inimitable Mr NewbieWhat's the debug message? Is it because the code is assuming Session is valid
even though it's not? I suspect that might be the problem...

In any event, if you don't want your users to see unhandled exception information,
consider setting up an error redirect page via the <customErrors> element
in web.config.

http://msdn.microsoft.com/library/d...rorsSection.asp

-Brock
DevelopMentor
http://staff.develop.com/ballen

> H, I have noticed that when the session has timed out, and you refresh
> the pag etc, you very often end up with debug messages etc. Is there
> any clean way to handle this so the users will not see the stack trace
> ?
> I know there is the option to turn on the friendly messages, will this
> do the trick >?
> Cheers
> The Inimitable Mr Newbie

Session timeouts

Hi

I've just been told that closing your browser closes your session on the
web-site you are viewing, is this true? If so, is this the browser that initiates
the closure, or the server?

Thanks
Kev"Mantorok" <spamthis@.spam.com> wrote in message
news:cbc5da882bbc88c8422cf73e68ca@.news.rmplc.co.uk ...

> I've just been told that closing your browser closes your session on the
> web-site you are viewing, is this true?

Totally untrue. If you want to make sure that a session is closed, you need
to provide a mechanism for a user to initiate it i.e. some sort of "Log out"
facility which tears down the session. The server is simply waiting to
respond to requests from clients - it cannot know when a browser has been
closed.

Do a Google search - this topic has been discussed ad nauseum...
http://www.msdner.com/forum/thread321607.html
"Mark Rae" <mark@.markN-O-S-P-A-M.co.uk> wrote in message
news:OjkCr%23AdGHA.4276@.TK2MSFTNGP03.phx.gbl...
> "Mantorok" <spamthis@.spam.com> wrote in message
> news:cbc5da882bbc88c8422cf73e68ca@.news.rmplc.co.uk ...
>> I've just been told that closing your browser closes your session on the
>> web-site you are viewing, is this true?
> Totally untrue. If you want to make sure that a session is closed, you
> need to provide a mechanism for a user to initiate it i.e. some sort of
> "Log out" facility which tears down the session. The server is simply
> waiting to respond to requests from clients - it cannot know when a
> browser has been closed.

Thank you for clarifying my thoughts, when I first heard it I immediately
said "How does the server know the client closed the browser?", silenced
followed.....

Cheers
Kev
"Mark Rae" <mark@.markN-O-S-P-A-M.co.uk> wrote in message
news:OjkCr%23AdGHA.4276@.TK2MSFTNGP03.phx.gbl...
> "Mantorok" <spamthis@.spam.com> wrote in message
> news:cbc5da882bbc88c8422cf73e68ca@.news.rmplc.co.uk ...
>> I've just been told that closing your browser closes your session on the
>> web-site you are viewing, is this true?
> Totally untrue. If you want to make sure that a session is closed, you
> need to provide a mechanism for a user to initiate it i.e. some sort of
> "Log out" facility which tears down the session. The server is simply
> waiting to respond to requests from clients - it cannot know when a
> browser has been closed.

Come to think of it - when I log in to my (internal) web-site it stores my
login in a session variable, however when I close the browser and re-open my
login session has gone.

What's happening here?

Thanks
Kev
"Mantorok" <mantorok@.mantorok.com> wrote in message
news:e3sbfk$6br$1@.newsfeed.th.ifl.net...

> Come to think of it - when I log in to my (internal) web-site it stores my
> login in a session variable, however when I close the browser and re-open
> my login session has gone.
> What's happening here?

Opening the browser again causes a new session to be created.
"Mark Rae" <mark@.markN-O-S-P-A-M.co.uk> wrote in message
news:Oy$AtTBdGHA.4912@.TK2MSFTNGP05.phx.gbl...
> "Mantorok" <mantorok@.mantorok.com> wrote in message
> news:e3sbfk$6br$1@.newsfeed.th.ifl.net...
>> Come to think of it - when I log in to my (internal) web-site it stores
>> my login in a session variable, however when I close the browser and
>> re-open my login session has gone.
>>
>> What's happening here?
> Opening the browser again causes a new session to be created.

Aha, thanks.

Kev
"Mantorok" <mantorok@.mantorok.com> wrote in message
news:e3scup$71j$1@.newsfeed.th.ifl.net...

> Aha, thanks.

http://www.google.com/search?source...22+IsNewSession
Covering a few items in this thread:

Closing your browser does nothing on the server. The server still waits
until timeout to get rid of the session. And, opening a browser creates a
new session. This means you now have two sessions, but you are only
connected to the newest session.

The way this works is through a session cookie, or server cookie. Even users
with normal cookies off can get these. There are some older browsers that
see both types of cookies as the same. And, yes, an industrious user can
refuse server cookies, as well. But it is rare.

When you open the browser, it will not reuse a server cookie, even if the
session has not timed out. This is for security purposes. So, it creates a
new connection and gets a new server cookie (session). If you open and close
the browser 100 times, you have 100 sessions until they time out, but you
cannot get to any for which you have closed the browser.

Another interesting topic. If you open a new browser instance using Control
+ N, both connect to the same session. If you use the menu, you have two
different sessions. Cool, eh?

Remember, the web is stateless, so it has no clue what the user is doing.

--
Gregory A. Beamer

*************************************************
Think Outside the Box!
*************************************************
"Mantorok" <spamthis@.spam.com> wrote in message
news:cbc5da882bbc88c8422cf73e68ca@.news.rmplc.co.uk ...
> Hi
> I've just been told that closing your browser closes your session on the
> web-site you are viewing, is this true? If so, is this the browser that
> initiates the closure, or the server?
> Thanks
> Kev
Cowboy,

Very good.

How? an industrious user can
refuse server cookies, as well. But it is rare.

more details please thanks for the education

SA

"Cowboy (Gregory A. Beamer)" <NoSpamMgbworld@.comcast.netNoSpamM> wrote in
message news:eeghAWCdGHA.5048@.TK2MSFTNGP04.phx.gbl...
> Covering a few items in this thread:
> Closing your browser does nothing on the server. The server still waits
> until timeout to get rid of the session. And, opening a browser creates a
> new session. This means you now have two sessions, but you are only
> connected to the newest session.
> The way this works is through a session cookie, or server cookie. Even
> users with normal cookies off can get these. There are some older browsers
> that see both types of cookies as the same. And, yes, an industrious user
> can refuse server cookies, as well. But it is rare.
> When you open the browser, it will not reuse a server cookie, even if the
> session has not timed out. This is for security purposes. So, it creates a
> new connection and gets a new server cookie (session). If you open and
> close the browser 100 times, you have 100 sessions until they time out,
> but you cannot get to any for which you have closed the browser.
> Another interesting topic. If you open a new browser instance using
> Control + N, both connect to the same session. If you use the menu, you
> have two different sessions. Cool, eh?
> Remember, the web is stateless, so it has no clue what the user is doing.
> --
> Gregory A. Beamer
> *************************************************
> Think Outside the Box!
> *************************************************
> "Mantorok" <spamthis@.spam.com> wrote in message
> news:cbc5da882bbc88c8422cf73e68ca@.news.rmplc.co.uk ...
>> Hi
>>
>> I've just been told that closing your browser closes your session on the
>> web-site you are viewing, is this true? If so, is this the browser that
>> initiates the closure, or the server?
>>
>> Thanks
>> Kev
>>
>>

Session timeouts

how can i disable session timeouts without affecting any program codings?You do NOT want to disable Session timeouts. Sessions time out for a very
good reason: Every time a user logs onto your site, a Session is created. If
you disabled their timeout, you would in essence, create a memory leak that
would take very little time to crash your application. What you SHOULD do is
handle Session timeouts effectively.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
The sun never sets on
the Kingdom of Heaven

"Fraijo" <Fraijo@.discussions.microsoft.com> wrote in message
news:FAE5CDD2-A0DF-451A-92E5-F7DCDA5F4953@.microsoft.com...
> how can i disable session timeouts without affecting any program codings?
You do NOT want to disable Session timeouts. Sessions time out for a very
good reason: Every time a user logs onto your site, a Session is created. If
you disabled their timeout, you would in essence, create a memory leak that
would take very little time to crash your application. What you SHOULD do is
handle Session timeouts effectively.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
The sun never sets on
the Kingdom of Heaven

"Fraijo" <Fraijo@.discussions.microsoft.com> wrote in message
news:FAE5CDD2-A0DF-451A-92E5-F7DCDA5F4953@.microsoft.com...
> how can i disable session timeouts without affecting any program codings?

Session Timeouts

I have developed an asp.net 2.0 app on my instance of server2003 and have
set IIS to timout in 40 minutes (asp.net|configuration) and it works just
fine - the app won't timeout until 40 minutes of inactivity passes.

However when deployed to a production server2003 machine with the very same
IIS settings, the app times out in 20 minutes. I have no specific timeout
statement either in code or web.config.

Any ideas?

--
Regards,
Gary BlakelyOn May 25, 6:48 am, "GaryDean" <GaryD...@.newsgroups.nospamwrote:

Quote:

Originally Posted by

I have developed an asp.net 2.0 app on my instance of server2003 and have
set IIS to timout in 40 minutes (asp.net|configuration) and it works just
fine - the app won't timeout until 40 minutes of inactivity passes.
>
However when deployed to a production server2003 machine with the very same
IIS settings, the app times out in 20 minutes. I have no specific timeout
statement either in code or web.config.
>
Any ideas?
>
--
Regards,
Gary Blakely


Hi Gary...

20 min is a default timeout period...
please add timeout configuration in web.config and set it to 40 min...
if this problem still remains please check your machine.config
file...

Thanks
Masudur
I guess I failed to say that I have tried all of the obvious solutions, some
of which, you suggest.

--
Regards,
Gary Blakely
"Masudur" <munnacs@.gmail.comwrote in message
news:1180069599.240101.129060@.g4g2000hsf.googlegro ups.com...

Quote:

Originally Posted by

On May 25, 6:48 am, "GaryDean" <GaryD...@.newsgroups.nospamwrote:

Quote:

Originally Posted by

>I have developed an asp.net 2.0 app on my instance of server2003 and have
>set IIS to timout in 40 minutes (asp.net|configuration) and it works just
>fine - the app won't timeout until 40 minutes of inactivity passes.
>>
>However when deployed to a production server2003 machine with the very
>same
>IIS settings, the app times out in 20 minutes. I have no specific
>timeout
>statement either in code or web.config.
>>
>Any ideas?
>>
>--
>Regards,
>Gary Blakely


>
Hi Gary...
>
20 min is a default timeout period...
please add timeout configuration in web.config and set it to 40 min...
if this problem still remains please check your machine.config
file...
>
Thanks
Masudur
>


On May 27, 6:53 pm, "GaryDean" <GaryD...@.newsgroups.nospamwrote:

Quote:

Originally Posted by

I guess I failed to say that I have tried all of the obvious solutions, some
of which, you suggest.
>


So, did you tried to set timeout in the web.config file?

<sessionState mode="InProc"
cookieless="true"
timeout="40"/>
Hi Gary,

This issue does look strange, if you're pretty sure that the obvious
web.config settings and IIS settings are correctly configured:

1) web.config, see Alexey's suggestion.

2) IIS: virtual directory properties -(Directory) Configuration ->
(Options) "Session timeout".

Maybe we're lack of some context or background information, would you
please depict more on the other configuration settings your web site
having? Thanks.

Regards,
Walter Wang (wawang@.online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
Walter,
Is there some reason cookieless="true" has to be coupled with the timeout
setting?

BTW, are there any downsides to cookieless sessions other than having the
sessionID in the url?

--
Regards,
Gary Blakely
"Walter Wang [MSFT]" <wawang@.online.microsoft.comwrote in message
news:3X3TzCZoHHA.1144@.TK2MSFTNGHUB02.phx.gbl...

Quote:

Originally Posted by

Hi Gary,
>
This issue does look strange, if you're pretty sure that the obvious
web.config settings and IIS settings are correctly configured:
>
1) web.config, see Alexey's suggestion.
>
2) IIS: virtual directory properties -(Directory) Configuration ->
(Options) "Session timeout".
>
>
Maybe we're lack of some context or background information, would you
please depict more on the other configuration settings your web site
having? Thanks.
>
>
Regards,
Walter Wang (wawang@.online.microsoft.com, remove 'online.')
Microsoft Online Community Support
>
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
>
This posting is provided "AS IS" with no warranties, and confers no
rights.
>


also, this is a little strange...
if iis is set to 20 and my web.config says timeout="40" at 22 minutes of no
activity the user does not get the login screen, the session variables are
just null.

--
Regards,
Gary Blakely

"Walter Wang [MSFT]" <wawang@.online.microsoft.comwrote in message
news:3X3TzCZoHHA.1144@.TK2MSFTNGHUB02.phx.gbl...

Quote:

Originally Posted by

Hi Gary,
>
This issue does look strange, if you're pretty sure that the obvious
web.config settings and IIS settings are correctly configured:
>
1) web.config, see Alexey's suggestion.
>
2) IIS: virtual directory properties -(Directory) Configuration ->
(Options) "Session timeout".
>
>
Maybe we're lack of some context or background information, would you
please depict more on the other configuration settings your web site
having? Thanks.
>
>
Regards,
Walter Wang (wawang@.online.microsoft.com, remove 'online.')
Microsoft Online Community Support
>
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
>
This posting is provided "AS IS" with no warranties, and confers no
rights.
>


I have new information and I am going to start a new thread on this

--
Regards,
Gary Blakely
"Walter Wang [MSFT]" <wawang@.online.microsoft.comwrote in message
news:3X3TzCZoHHA.1144@.TK2MSFTNGHUB02.phx.gbl...

Quote:

Originally Posted by

Hi Gary,
>
This issue does look strange, if you're pretty sure that the obvious
web.config settings and IIS settings are correctly configured:
>
1) web.config, see Alexey's suggestion.
>
2) IIS: virtual directory properties -(Directory) Configuration ->
(Options) "Session timeout".
>
>
Maybe we're lack of some context or background information, would you
please depict more on the other configuration settings your web site
having? Thanks.
>
>
Regards,
Walter Wang (wawang@.online.microsoft.com, remove 'online.')
Microsoft Online Community Support
>
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
>
This posting is provided "AS IS" with no warranties, and confers no
rights.
>

Session timeouts and dynamic MasterPages

Hi,

I have a site which uses dynamic MasterPages. The selection of the
MasterPage to use is determined by an encrypted QueryString. Session_Start
looks for the presence of the QueryString, decrypts it, and sets up a
Session variable holding the name of the MasterPage to use. The contents
pages interrogate this Session variable in the Page_PreInit method (has to
be done here) and apply the correct MasterPage accordingly.

Works perfectly, until / unless the session times out. I'm checking for this
at the top of the Page_PreInit method using if (Session.IsNewSession) - this
works. If the IsNewSession is true, then the code redirects to a generic
page informing the user that they have been idle too long, and that they
must log in again. Fairly standard stuff.

HOWEVER, the problem I have is that the contents page then continues to load
i.e. its Page_Load fires, even though I've redirected to a different page.
I've worked round this by use of a boolean variable, as follows:

The code is as below:

bool blnTimedOut = false; // fudge variable

private void Page_PreInit(object sender, System.EventArgs e)
{
if (Session.IsNewSession)
{
blnTimedOut = true; // fudge code
Response.Redirect("~/sessionTimedOut.htm", false);
return;
}
this.MasterPageFile = "~/master/" + Session["strSite"].ToString() +
".master";
}

protected void Page_Load(object sender, EventArgs e)
{
// this event fires even though Response.Redirect in Page_PreInit
if (blnTimedOut ) // fudge code
{
return;
}
// rest of Page_Load code
}

Whilst the above most certainly works, I'm wondering if there is a better /
neater / more efficient way of doing this. E.g. is there a property of the
Page object that I can set in Page_PreInit to tell it not to fire any
further Page events...? I've done a trawl through MSDN and Google but have
drawn a blank...

Any assistance gratefully received.

MarkMark,
Don't think so. I say, If it ain't broke, don't fix it!
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com
"Mark Rae" wrote:

Quote:

Originally Posted by

Hi,
>
I have a site which uses dynamic MasterPages. The selection of the
MasterPage to use is determined by an encrypted QueryString. Session_Start
looks for the presence of the QueryString, decrypts it, and sets up a
Session variable holding the name of the MasterPage to use. The contents
pages interrogate this Session variable in the Page_PreInit method (has to
be done here) and apply the correct MasterPage accordingly.
>
Works perfectly, until / unless the session times out. I'm checking for this
at the top of the Page_PreInit method using if (Session.IsNewSession) - this
works. If the IsNewSession is true, then the code redirects to a generic
page informing the user that they have been idle too long, and that they
must log in again. Fairly standard stuff.
>
HOWEVER, the problem I have is that the contents page then continues to load
i.e. its Page_Load fires, even though I've redirected to a different page.
I've worked round this by use of a boolean variable, as follows:
>
The code is as below:
>
bool blnTimedOut = false; // fudge variable
>
private void Page_PreInit(object sender, System.EventArgs e)
{
if (Session.IsNewSession)
{
blnTimedOut = true; // fudge code
Response.Redirect("~/sessionTimedOut.htm", false);
return;
}
this.MasterPageFile = "~/master/" + Session["strSite"].ToString() +
".master";
}
>
protected void Page_Load(object sender, EventArgs e)
{
// this event fires even though Response.Redirect in Page_PreInit
if (blnTimedOut ) // fudge code
{
return;
}
// rest of Page_Load code
}
>
>
Whilst the above most certainly works, I'm wondering if there is a better /
neater / more efficient way of doing this. E.g. is there a property of the
Page object that I can set in Page_PreInit to tell it not to fire any
further Page events...? I've done a trawl through MSDN and Google but have
drawn a blank...
>
Any assistance gratefully received.
>
Mark
>
>
>


"Peter Bromberg [C# MVP]" <pbromberg@.yahoo.nospammin.comwrote in message
news:6B9E1F51-8A8C-4545-9C52-B4868DEA43F1@.microsoft.com...

Quote:

Originally Posted by

Don't think so.


OK.

Quote:

Originally Posted by

I say, If it ain't broke, don't fix it!


Well, yeah, but I'm always interested in finding better ways of doing
things...

Maybe there are none in this particular case... There certainly seems to be
no way of one of the "early" Page methods telling the "later" ones not to
fire... This can get annoying if the creation of the page needs to be
aborted in the Page_PreInit, and you subsquently have Page_Init, Page_Load,
Page_PreRender and Page_Unload... :-)

Nil desperandum - it works...
Hmmm.
I suppose you *could* do that, e.g. have a boolean somewhere and the "early"
lifecycle method / event can set this, and your code in the later one would
check for it and only execute certain code if it's true, no?
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com
"Mark Rae" wrote:

Quote:

Originally Posted by

"Peter Bromberg [C# MVP]" <pbromberg@.yahoo.nospammin.comwrote in message
news:6B9E1F51-8A8C-4545-9C52-B4868DEA43F1@.microsoft.com...
>

Quote:

Originally Posted by

Don't think so.


>
OK.
>

Quote:

Originally Posted by

I say, If it ain't broke, don't fix it!


>
Well, yeah, but I'm always interested in finding better ways of doing
things...
>
Maybe there are none in this particular case... There certainly seems to be
no way of one of the "early" Page methods telling the "later" ones not to
fire... This can get annoying if the creation of the page needs to be
aborted in the Page_PreInit, and you subsquently have Page_Init, Page_Load,
Page_PreRender and Page_Unload... :-)
>
Nil desperandum - it works...
>
>
>


"Peter Bromberg [C# MVP]" <pbromberg@.yahoo.nospammin.comwrote in message
news:C53DF6B7-E05D-4B2A-B949-FC9E6CB1494E@.microsoft.com...

Quote:

Originally Posted by

I suppose you *could* do that, e.g. have a boolean somewhere and the
"early"
lifecycle method / event can set this, and your code in the later one
would
check for it and only execute certain code if it's true, no?


Er, did you actually *read* the code in my original post...?

That is *precisely* what I'm doing... ;-)