Then, i got a problem the application worws fine with session time in develoment server (starting with visual studio), but whn i upload compiled web application to web server, session time is corrupted, it close very fast or not close, provider does ´t make
a memory pool for my application, then the first solution that ocured to me is renew session automatically each time to time.
I already try to use this examples for renew session:
Using a Timer + UpdatePanel<Trigger> combination for execute server code that make some change to session state (create a innecesary variable, for example) each time to time, this works in my case i created a counter and show it to the user each Tick,
but session never refreshed.
Using a combination of non visible iframe that implemets postbacks each time to time like that:
in the cases, i implements the code into user control. all codes do what
it should do, but neither renew session.
I remember had readed in a post that this can be because i am usen updatepanel in a page.
Then, can you help me? i need find a code for renew session trasparent by user, how this page when i writing the post, without use navigator cookies. any idea?
Pharsat
0 Points
1 Post
Session state doesn´t renew
Apr 12, 2012 09:38 PM|LINK
Hi, i have the next structure in my application:
1 i've a user control, it has a menú that rebind every control load using user info stored in session state and a exit button
2 i've a master page that have a image head, and body content (only visual no controls, any code)
3 i've pages based in the master page that include, each one, the user control. this page have a UpdatePanel like this:
<form id="form1" runat="server"> <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <%--Form content --%> </asp:UpdatePanel> </form>Then, i got a problem the application worws fine with session time in develoment server (starting with visual studio), but whn i upload compiled web application to web server, session time is corrupted, it close very fast or not close, provider does ´t make a memory pool for my application, then the first solution that ocured to me is renew session automatically each time to time.
I already try to use this examples for renew session:
if (User.Identity.IsAuthenticated) { // Refresh this page 60 seconds before session timeout, effectively resetting the session timeout counter. MetaRefresh.Attributes["content"] = Convert.ToString((Session.Timeout * 60) - 180) + ";url=KeepSessionAlive.aspx?q=" + DateTime.Now.Ticks; WindowStatusText = "Last refresh " + DateTime.Now.ToShortDateString() + " " + DateTime.Now.ToShortTimeString(); }and webconfig file configuration like that:
<authentication mode="Forms"> <forms name="Pharsat" timeout="30" protection="All" loginUrl="~/Login.aspx" slidingExpiration="true" /> </authentication> <sessionState mode="InProc" cookieless="false" timeout="30"/>in the cases, i implements the code into user control. all codes do what it should do, but neither renew session.
I remember had readed in a post that this can be because i am usen updatepanel in a page.
Then, can you help me? i need find a code for renew session trasparent by user, how this page when i writing the post, without use navigator cookies. any idea?
Thank you very much, Pharsat.