Setting the Session timeout for a specific page.

U

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.
 
J

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.
 
K

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
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.





UJ said:
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.
 
J

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"
/>






Kevin Jones said:
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 said:
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.





UJ said:
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.
 
K

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
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"
/>






Kevin Jones said:
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 said:
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.





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.
 

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

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,070
Latest member
BiogenixGummies

Latest Threads

Top