Click here to Skip to main content
15,901,666 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi every one,

I am developing an application in which there are 5 session variables persists through out the application and they will be timed out for every 5 minuted.But in a particular page i am uploading an excel to database, this may take about 20-30 minutes.So these session variables are getting timed out in the mean while.I need some solution to increase the session time only that particular upload form.Please give your valuable suggestions to achieve this.


Thanks,
Harsha
Posted

1 solution

Hi,

You should be able to set the session-timeout programmatically by just writing:
Session.Timeout = 60;

Here is the thread I found about this:
http://stackoverflow.com/questions/763541/set-long-timeout-for-selected-session-variable[^]
And the MSDN article about the property:
http://msdn.microsoft.com/en-us/library/system.web.sessionstate.httpsessionstate.timeout.aspx[^].

Hope this helps.


Best regards and happy coding,
Chris
 
Share this answer
 
Comments
Harsha 2 6-Aug-11 3:44am    
Thanks for the reply...
If i navigate to some other page after importing excel, which time out property will be effecting? either previous one in web.config or the pro grammatically coded one in that page?
Christoph Keller 6-Aug-11 3:54am    
If you set the Timeout programmatically before the upload, the timeout is valid for the whole user-session. So you should still have the longer timeout after the processing.

If you want to reset the timeout after the generate process, do it the same way as you did it to make it longer, and everything should be fine :)
Harsha 2 6-Aug-11 3:57am    
Okay Thanks for the reply
It really helped to resolve my problem.
Christoph Keller 6-Aug-11 4:03am    
You're welcome, I'm glad to hear that it helped.

If the question is solved, please mark the answer as "answer", thank you :)

Have a nice day and always happy coding,
Chris

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900