.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
Abhijit
Post New Web Links

Session State Expiration after Application pool recycle

Posted By:      Posted Date: November 01, 2010    Points: 0   Category :ASP.Net
 

Hello All we have a global ships position tracking website which runs smoothly until IIS application pool recycles.When there is workerprocess recycling looks like session state expires as a result i loose all session data and when customer clicks refresh button he is redirected to login page.

In web.config Session state mode is set to InProc so i changed it to State Server but to my luck i have MAP object which is not serialiazable which is causing the maps from not appearing on the website.I tried adding serializable attribute to the object class but still not succesfull.Our website is accessed by our customers whose count is more than 1000.

Changing the session state mode from InProc to StateServer can really slow down the response time so Is it good to go further fix the serailizable issues and move to state server?.

Is there any way I can retain my session data when application pool recyles?..

Stopping Application pool from recycling may not be a good idea considering health factor of web server.

 

Any Suggestions?..

 

 

 

 

 

 

 

 




View Complete Post


More Related Resource Links

application pool recycle fails when any session alive with claims sharepoint 2010

  

Hi, 

I'm having once interesting (or annoying probably) in my SharePoint environment.

To give you the context of my environment. 

I've SharePoint 2010 Farm. 

One web application configured as claims (with extended web set to internet zone)

Extended web is enabled to have custom membership provider - that is integrated with CRM system (so, i don't have default sql membership database schema and it's also without any roles provider).

Now, this webapplication is running under one application pool (ofcourse), that's schedule to recycle every night. 

Now, in order to simulate this issues that i'm having. I'm reseting this recycle issue. Rescheduling this causes application pool to recycle (default behavior - it goes well). But when scheduled recycle occurs, i'm getting many errors in event log and IIS logs).

 

Event Log (2 errors): 

Application Error: Event ID: 1000 (100)

Faulting application name: w3wp.exe, version: 7.5.7600.16385, time stamp: 0x4a5bd0eb

Faulting module name: KERNELBASE.dll, version: 6.1.7600.16385, time stamp: 0x4a5bdfe0

Exception code: 0xe053534f

Fault offset: 0x000000000000aa7d

Faulting process id: 0x%9

Faulting application start time: 0x%10

Faulting application path: %11

Faulting module p

APPLICATION STATE AND SESSION STATE HELP

  

User Interface: 2 Labels;  1 Buttons

Requirements: Create a Web Page in ASPx that will do the following:

 

1)      One label will provide a count of how many times Button 1 has been clicked in the current session.

2)      One label will provide a count of how many times Button 1 has been clicked by all users of the application.

          The Application Code for the Button should start at 100 (set this in the Global.asax file).

 

this is what i have so far but i cant seem to get the application state to work properly.

aspx.vb


Partial Class _Default
    Inherits System.Web.UI.Page
    Dim clickcount As Integer


    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        If Session("ClickCount") Is Nothing Then
            clickcount = 0
        Else
            clickcount = CInt(Session("ClickCount"))
        End If
  

Error occurred in deployment step 'Recycle IIS Application Pool': Provider load failure

  

Hello,

I am using Visual Studio 2010 to create page layouts and preview images(http://blog.beckybertram.com/Lists/Posts/Post.aspx?ID=71). I was successful in creating page layouts but the image was not coming properly.

So I decided to change the path of image and deploy the project (Empty SharePoint project). But this time, I am getting an error
Error occurred in deployment step 'Recycle IIS Application Pool': Provider load failure
I am sure there is no relation between changing image path in elements.xml and this error.

I also browsed through and found some related issues, but they are not specific to VS 2010 or SharePoint 2010. And I am apprehensive of implementing them.
http://msdn.microsoft.com/en-us/library/bb961987(VS.90).aspx

1. The logged in user is site collection admin and local admin
2. Windows Management Instrumentation service is running
3. App pool's identity is configured to the local admin & password has not changed.

Thanks in advance

_____________________________
Vighnesh Bendre
http://markviky.blogspot.com

 


Permissions for DirectoryEntry.Invoke("Recycle") on Application Pool

  

I'm trying to write code so that certain website users (not Windows users!) [editorial staff] can recycle the application pool of the current site.  I've gotten through finding the name of the current site's application pool and even how to recycle it, but I cannot seem to get the proper permissions.  Below is some hack code:

Protected Sub cmdRecycleAppPool_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles cmdRecycleAppPool.Click      
      Dim strPoolName As String = Request.ServerVariables("INSTANCE_META_PATH").ToString.Trim

      Dim strVirtDirPath As String = AppDomain.CurrentDomain.FriendlyName
      strVirtDirPath = strVirtDirPath.Substring(4)
      Dim intIndex As Integer = strVirtDirPath.Length + 1
      intIndex = strVirtDirPath.LastIndexOf("-", intIndex - 1, intIndex - 1)
      intIndex = strVirtDirPath.LastIndexOf("-", intIndex - 1, intIndex - 1)

      strVirtDirPath = "IIS://localhost/" & strVirtDirPath.Remove(intIndex)

      Dim objDirEntry As New DirectoryEntry(strVirtDirPath)

      strPoolName = objDirEntry.Properties("AppPoolId").Value.ToString

      strPoolName = "IIS://localhost/W3SVC/AppPools/" & strPoolName
      objDirEntry = New DirectoryEntry(strPoolName)

      Try
         Impersonat

WCF Service isnt restarting after Application Pool Recycle

  

Hi. My WCF Service isnt restarting after the app pool recycles. I have no control over how often the pool is recycled (shared hosting) .How do I get the wcf service to restart on pool-recycle ?

Thanks,

Ash.


Save Workflow Runtime as Application State or Session State for a website with multiple users?

  

I used Windows Workflow Foundation 3.5 as a page flow navigation for a ASP.NET website's Previous and Next page navigation.

The site acts like a shopping cart and each user has his own session and user data.  The app only has one WF.  I am not sure if I should generate one Workflow Runtime for every user or for simply generate one workflow Runtime for the entire application in my case?   

In the global.asax:

void Application_Start(object sender, EventArgs e)
    {
       
    } 

void Application_End(object sender, EventArgs e)
    {
                         
    }
    
    void Session_Start(object sender, EventArgs e)
    {
        // Code that runs when a new session is started
        System.Workflow.Runtime.WorkflowRuntime workflowRuntime = new System.Workflow.Runtime.WorkflowRuntime(WorkflowManager.WorkflowRuntimeKey);

      

SQL Server Session state problem.

  

Hi to all,


I have some things that I want to know. I am right now using a free asp.net webhosting ("somee.com"). The problem is that when I am visiting a page, there's a tendency that values stored in my session variables are lost. Therefore, it causes an error when the requested page is loaded.

1. I am thinking of using sessionState mode="SqlServer". Will it solve my problem?

Actualy Im working on it but Im having problems when connecting to the sql database.

2.  Is that a problem in the webhost?

3. Do free webhosting sites provide allow session state in the sql server?. Because ive tried it locally into my computer and error say's i should intall the ASP.NET Session State SQL Server version 2.0 or above.




Session and Application Variables

  

I have a web application in which i need to logout the user if he clicks the logout button or even if he closes his browser window. On Logout button click, i am doing session.Abandon(), but how to go about his browser window close.

Can anybody help with a code sample.


Best Practices: Fast, Scalable, and Secure Session State Management for Your Web Applications

  

ASP.NET provides a number of ways to maintain user state, the most powerful of which is session state. This article takes an in-depth look at designing and deploying high-performance, scalable, secure session solutions, and presents best practices for both existing and new ASP.NET session state features straight from the ASP.NET feature team.

Mike Volodarsky

MSDN Magazine September 2005


ASP.NET: Nine Options for Managing Persistent User State in Your ASP.NET Application

  

ASP.NET provides many different ways to persist data between user requests. You can use the Application object, cookies, hidden fields, the Session or Cache objects, and lots of other methods. Deciding when to use each of these can sometimes be difficult. This article will introduce the aforementioned techniques and present some guidelines on when to use them. Although many of these techniques existed in classic ASP, best practices for when to use them have changed with the introduction of the .NET Framework. To persist data in ASP.NET, you'll have to adjust what you learned previously about handling state in ASP.

Steven Smith

MSDN Magazine April 2003


Taming the Stateless Beast: Managing Session State Across Servers on a Web Farm

  

Running a Web farm means managing session state across servers. Since session state can't be shared across a Web farm with Internet Information Services 5.0, a custom solution is required. One such solution using a tool called the session manager is described here. The article begins with a description of the SQL Server database used to store state information, the stored procedures used to update it, and the retrieval of session data. ASP code drives the session manager tool and the COM and COM+ components that run the stored procedures.

John Papa

MSDN Magazine October 2000


Session State Problem

  

Hi,

 

I just for the first time into a session state problem. So I am hoping someone

here has the answer.

 

I have written an ASP.Net website and tried to implement the common poor mans online user count.
The problem I am having is the following.

On App_Start I create a variable and assign it the value of 0;

Then increase the number on session_start and decrement on session_end.

On my local IIS it works perfectly from IE8 and Opera. The value increments correctly.
As soon as I upload to my live server. The value increments on every link I click and every page refresh when I test with IE8.
This does not happen when testing with Opera.

Could someone please shed some light on the subject.

 

Thanks

 

Louis Lews


How to Keep conntion pool and application pool for certain time?

  

In my current system MOSS and windows 2003, I do not know where to see connection pool live time ? and Application pool live time?

How to keep live these for certain number of hours? Where can I change? Is it possible to keep minimum number of connection pool live always?

 

Thanks for help in advance.


ItsMeSri

Good news for those of you who get "Unable to make the session state request to the session state se

  

Dear all,

Due to the known problem of session variables getting lost if using InProc-server during frequent changes in development, I had to choose between SQL and ASP.NET State server, so I opted for the second. Initially, all fine, but after using it for a few days, I started to get this error:

 Server Error in '/cv2' Application.
Unable to make the session state request to the session state server. Please ensure that the ASP.NET State service is started and that the client and server ports are the same.  If the server is on a remote machine, please ensure that it accepts remote requests by checking the value of HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\aspnet_state\Parameters\AllowRemoteConnection.  If the server is on the local machine, and if the before mentioned registry value does not exist or is set to 0, then the state server connection string must use either 'localhost' or '127.0.0.1' as the server name.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Web.HttpException: Unable to make the session state request to the session state server. Please ensure that the ASP.NET State service is started and that the clie

Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend