423,850 Members | 1,253 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 423,850 IT Pros & Developers. It's quick & easy.

Setting the Session timeout for a specific page.

P: n/a
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.
Aug 25 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
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" <fr**@nowhere.comwrote in message news:Oe**************@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.



Aug 25 '06 #2

P: n/a
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" <fr**@nowhere.comwrote in message news:Oe**************@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.



Aug 28 '06 #3

P: n/a
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" <kj**********@develop.comwrote in message
news:Ok**************@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" <fr**@nowhere.comwrote in message news:Oe**************@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.


Aug 28 '06 #4

P: n/a
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:
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" <kj**********@develop.comwrote in message
news:Ok**************@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" <fr**@nowhere.comwrote in message news:Oe**************@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.


Aug 28 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.