Home All Groups Group Topic Archive Search About

Setting the Session timeout for a specific page.

Author
25 Aug 2006 6:10 PM
UJ
I have a page where the user can upload a video file. As you can guess, this
may take a while. Is there a way I can change the session timeout for just
this one page? I would also want to change the forms authentication to be a
large value for that page also.

TIA - Jeff.

Author
25 Aug 2006 6:47 PM
Juan T. Llibre
You can set the Session Timeout time, in minutes, in code, in any page.

Session.Timeout [=nMinutes]

Example :

Session.Timeout = 40

The Page_Load event is a good place to set this.




Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
Show quote
"UJ" <f***@nowhere.com> wrote in message news:Oe8jVHHyGHA.4232@TK2MSFTNGP05.phx.gbl...
>I have a page where the user can upload a video file. As you can guess, this may take a while. Is
>there a way I can change the session timeout for just this one page? I would also want to change
>the forms authentication to be a large value for that page also.
>
> TIA - Jeff.
>
>
Author
28 Aug 2006 9:27 AM
Kevin Jones
But that sets the timeout for this session, not just for this page.

You can't set the session timeout for a specific page, as the session
applies to all requests used in this session,

Kevin Jones

Juan T. Llibre wrote:
Show quote
> You can set the Session Timeout time, in minutes, in code, in any page.
>
> Session.Timeout [=nMinutes]
>
> Example :
>
> Session.Timeout = 40
>
> The Page_Load event is a good place to set this.
>
>
>
>
> Juan T. Llibre, asp.net MVP
> aspnetfaq.com : http://www.aspnetfaq.com/
> asp.net faq : http://asp.net.do/faq/
> foros de asp.net, en español : http://asp.net.do/foros/
> ===================================
> "UJ" <f***@nowhere.com> wrote in message news:Oe8jVHHyGHA.4232@TK2MSFTNGP05.phx.gbl...
>> I have a page where the user can upload a video file. As you can guess, this may take a while. Is
>> there a way I can change the session timeout for just this one page? I would also want to change
>> the forms authentication to be a large value for that page also.
>>
>> TIA - Jeff.
>>
>>
>
>
>
Author
28 Aug 2006 10:14 AM
Juan T. Llibre
re:
> But that sets the timeout for this session, not just for this page.

Correct.

re:
> You can't set the session timeout for a specific page,
> as the session applies to all requests used in this session,

Correct, too.

I did not state, or imply, that the setting applies to individual pages, did I ?

"You can set the Session Timeout time, in minutes, in code, in any page"

Saying that you can *set* a Session's duration in any page is not the
same as saying that the Session's duration applies only to that page.

If the statement was : "You can set the Session Timeout time, in minutes, in code, *for* any page",
then it would mean that the Session's duration applies only to that page.

However, in retrospect, I suspect that Jeff also needs to change the
executionTimeout and maxRequestLength values, besides the Session.Timeout value.

If he does't want his video upload interrupted
because of the page timing out, he should set  :

<httpRuntime executionTimeout="NumberOfSeconds" />

to a sufficiently large value ( longer than what the file will take to upload ).

He should probably also change the httpRuntime's maxRequestLength:

<httpRuntime
      maxRequestLength="MaxNumberOfKilobytes"
      />

<httpRuntime
      maxRequestLength="4096"
      />
....is the default, and stands for 4MB max file size.

Jeff will probably need a much higher value, if he's accepting video files.

So, he should set them like this :

<httpRuntime
      executionTimeout="NumberOfSeconds"
      maxRequestLength="MaxNumberOfKilobytes"
      />

Additionally, he should increase the Session duration to the time needed
to upload the largest file he expects to be uploaded, if the user isn't going
somewhere else when the file upload finishes :

<sessionState
   timeout="HoweverLongItTakesToUploadTheLargestFile"
    />

That's an integer which stands for minutes.

Example for 60 minutes :

<sessionState
   timeout="60"
    />





Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
Show quote
"Kevin Jones" <kjonesNOSPAM@develop.com> wrote in message
news:Ok9J4QoyGHA.4336@TK2MSFTNGP06.phx.gbl...
> But that sets the timeout for this session, not just for this page.
>
> You can't set the session timeout for a specific page, as the session applies to all requests used
> in this session,
>
> Kevin Jones

> Juan T. Llibre wrote:
>> You can set the Session Timeout time, in minutes, in code, in any page.
>>
>> Session.Timeout [=nMinutes]
>>
>> Example :
>>
>> Session.Timeout = 40
>>
>> The Page_Load event is a good place to set this.
>>
>>
>>
>>
>> Juan T. Llibre, asp.net MVP
>> aspnetfaq.com : http://www.aspnetfaq.com/
>> asp.net faq : http://asp.net.do/faq/
>> foros de asp.net, en español : http://asp.net.do/foros/
>> ===================================
>> "UJ" <f***@nowhere.com> wrote in message news:Oe8jVHHyGHA.4232@TK2MSFTNGP05.phx.gbl...
>>> I have a page where the user can upload a video file. As you can guess, this may take a while.
>>> Is
>>> there a way I can change the session timeout for just this one page? I would also want to change
>>> the forms authentication to be a large value for that page also.
>>>
>>> TIA - Jeff.
Author
28 Aug 2006 10:27 AM
Kevin Jones
> I did not state, or imply, that the setting applies to individual
pages, did I ?

The question was:

"Is there a way I can change the session timeout for just this one page? "

So yes (IMO) your answer did imply this. I just want to make sure that
Jeff was aware that this wasn't the case,

Kevin

Juan T. Llibre wrote:
Show quote
> re:
>> But that sets the timeout for this session, not just for this page.
>
> Correct.
>
> re:
>> You can't set the session timeout for a specific page,
>> as the session applies to all requests used in this session,
>
> Correct, too.
>
> I did not state, or imply, that the setting applies to individual pages, did I ?
>
> "You can set the Session Timeout time, in minutes, in code, in any page"
>
> Saying that you can *set* a Session's duration in any page is not the
> same as saying that the Session's duration applies only to that page.
>
> If the statement was : "You can set the Session Timeout time, in minutes, in code, *for* any page",
> then it would mean that the Session's duration applies only to that page.
>
> However, in retrospect, I suspect that Jeff also needs to change the
> executionTimeout and maxRequestLength values, besides the Session.Timeout value.
>
> If he does't want his video upload interrupted
> because of the page timing out, he should set  :
>
> <httpRuntime executionTimeout="NumberOfSeconds" />
>
> to a sufficiently large value ( longer than what the file will take to upload ).
>
> He should probably also change the httpRuntime's maxRequestLength:
>
> <httpRuntime
>       maxRequestLength="MaxNumberOfKilobytes"
>       />
>
> <httpRuntime
>       maxRequestLength="4096"
>       />
> ...is the default, and stands for 4MB max file size.
>
> Jeff will probably need a much higher value, if he's accepting video files.
>
> So, he should set them like this :
>
> <httpRuntime
>       executionTimeout="NumberOfSeconds"
>       maxRequestLength="MaxNumberOfKilobytes"
>       />
>
> Additionally, he should increase the Session duration to the time needed
> to upload the largest file he expects to be uploaded, if the user isn't going
> somewhere else when the file upload finishes :
>
> <sessionState
>    timeout="HoweverLongItTakesToUploadTheLargestFile"
>     />
>
> That's an integer which stands for minutes.
>
> Example for 60 minutes :
>
> <sessionState
>    timeout="60"
>     />
>
>
>
>
>
> Juan T. Llibre, asp.net MVP
> aspnetfaq.com : http://www.aspnetfaq.com/
> asp.net faq : http://asp.net.do/faq/
> foros de asp.net, en español : http://asp.net.do/foros/
> ===================================
> "Kevin Jones" <kjonesNOSPAM@develop.com> wrote in message
> news:Ok9J4QoyGHA.4336@TK2MSFTNGP06.phx.gbl...
>> But that sets the timeout for this session, not just for this page.
>>
>> You can't set the session timeout for a specific page, as the session applies to all requests used
>> in this session,
>>
>> Kevin Jones
>
>> Juan T. Llibre wrote:
>>> You can set the Session Timeout time, in minutes, in code, in any page.
>>>
>>> Session.Timeout [=nMinutes]
>>>
>>> Example :
>>>
>>> Session.Timeout = 40
>>>
>>> The Page_Load event is a good place to set this.
>>>
>>>
>>>
>>>
>>> Juan T. Llibre, asp.net MVP
>>> aspnetfaq.com : http://www.aspnetfaq.com/
>>> asp.net faq : http://asp.net.do/faq/
>>> foros de asp.net, en español : http://asp.net.do/foros/
>>> ===================================
>>> "UJ" <f***@nowhere.com> wrote in message news:Oe8jVHHyGHA.4232@TK2MSFTNGP05.phx.gbl...
>>>> I have a page where the user can upload a video file. As you can guess, this may take a while.
>>>> Is
>>>> there a way I can change the session timeout for just this one page? I would also want to change
>>>> the forms authentication to be a large value for that page also.
>>>>
>>>> TIA - Jeff.
>
>
>

AddThis Social Bookmark Button