Click here to Skip to main content
15,884,473 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi Everyone,
I have this problem with website application, coming to point, my exact problem is i get session expired and app pool recycled, which deletes all of my page progress and etc, firstly i was using my sign info in session, though now i am also storing it in cookies, so when the session expires, application restores the login info from cookies.

C#
Session.Add("sUserID", src.userID);
Session.Add("suserLname", src.userLName);
Response.Cookies["abcdefCookie3"].Value = src.userID;
Response.Cookies["abcdefCookie3"].Expires = DateTime.Now.AddDays(1);
Response.Cookies["abcdefCookie4"].Value = src.userFName;
Response.Cookies["abcdefCookie4"].Expires = DateTime.Now.AddDays(1); 


but the other information like datatables in session, which of course gets lost with so called app pool recycling...

It Runs fine on LOCALHOST but on hosting services i have been facing this issue, i have these tried these hosters
1. One&One Website hosting
2. HostMySite
3. SiteGator
and
4. CreativeOn

i thought it might be overflowing memory with a lot of session variables so i deployed a middle page (navigator) in which i used following code
C#
string frwdAdd = Request.QueryString["frwdAdd"];
string sUserID = (string)Session["sUserID"];
string suserLname = (string)Session["suserLname"];
Session.Clear();
Session.Add("sUserID",sUserID);
Session.Add("suserLname",suserLname);
Response.Redirect("~/" + frwdAdd, true);

using this i did get a little bit more time before session expired/app pool recycled, but eventually it expires...
so guys any hint, any link, any help would be appreciated A LOT.
Posted
Updated 24-Apr-13 19:34pm
v2
Comments
psychic6000 25-Apr-13 3:02am    
[I am using LINQ with connection string defined inside web.config]

1 solution

for application pool set the pool size in IIS
and use web config file to configure the session timout
;Max Pool Size=75000"/>
 
Share this answer
 
v2
Comments
psychic6000 25-Apr-13 1:43am    
i have set the session time out to at least 20 min in web.config (i also tried 120 min etc). but how can i set the pool size in online hosting space???
psychic6000 25-Apr-13 2:48am    
I am using a web hosting, in which they dont allow me to configure IIS Pool, or i cannot find it in their online interface for management...
CringTee 25-Apr-13 3:22am    
M too having same problem. some time it expires within a second. any body having a solution please help!

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