Session on End event if using state server or sql server

The documentation for 'Session_OnEnd' indicates that it not invoked if the session is stored in sql server or state server.

Any workarounds to capture Session_OnEnd if the session is maintained in state server or sql server?

Thanks in advance.

0
vitta
7/1/2006 10:50:15 AM
asp.net.state-management 8807 articles. 0 followers. Follow

1 Replies
976 Views

Similar Articles

[PageSpeed] 7
Get it on Google Play
Get it on Apple App Store

I solved in the following way.
The approach is in check for the new / existing session on each request at global.asax.

Here is the simple work around 
private void Application_PreRequestHandlerExecute(Object sender, EventArgs e)
{
        if (Context.Session != null)
        {
            if (Session.IsNewSession)
            {
                         // your custom code
            }
        }
}

    

0
vitta
1/24/2008 6:58:31 PM
Reply:

Similar Artilces:

Session_End Event in global.asax is not exeuting when the session state mode is state server or sql server
Hi, The code written in global.asax file Session_End()  Method is not executing when the session state mode is state Server Or sqlserver. can any body please suggest me how can i trap the seesion_end Event when the mode is state server.            You cannot.  Only when your session state is set to InProc will that event fire.  This is by design. The other 2 modes represent out of process (and possibly off-box) services that do not have the ability to raise events inside of your app.  Mike Banavige~~~~~~~~~~~~Need a site code s...

Unable to use session state server....requires session state server version 2.0 or above.
So, I have Windows 2003 IIS latest service packs running. Its running .NET 2.0 and .NET 1.1 applications in seperate application pools. Just today I applied the following patch to the server. (The server is not running any 3.0 or 3.5 applications or application pools)  Microsoft .NET Framework 3.5 Service Pack 1 and .NET Framework 3.5 Family Update (KB951847) x86 Microsoft .NET Framework 3.5 Service Pack 1 is a full cumulative update that contains many new features building incrementally upon .NET Framework 2.0, 3.0, 3.5, and includes cumulative servicing upda...

This version of Microsoft Sql Server Management Studio can only be used to connect to Sql Server 2000 and Sql Server 2005 servers
When I connect SQL Server 2005 to a remote database i get the error: "This version of Microsoft Sql Server Management Studio can only be used to connect to Sql Server 2000 and Sql Server 2005 servers". Can I confirm it is because: the remote db is of SQL Server 2008? There is a soln mentioned in http://forums.asp.net/t/1324047.aspx Did anybody try this (installing 2008 express: http://www.microsoft.com/express/sql/download/)? I am just checking again, whether it will disturb my existing SQL Server installation, in any means...? Though it is mentioned that it will g...

Using SQL Server for Session State Management
Hello, We are implementing session management in a custom database, provided by the following sessionState configuration in web.config: <sessionState mode="SQLServer" stateConnectionString=""    allowCustomSqlDatabase="true"    sqlConnectionString="Data Source=serverName;Database=databaseName;User Id=userName;Password=password"    cookieless="false" timeout="60" /> For reasons to complicated to go into, our company imposes standards on how/where database connection strings get stored. Is there an attribute or method by which I co...

how to use state server to manage sessions
How does one use the state server? Can anyone explain the process how the state server is used or give me some links to which I can refer to, which will explain the same? Basically, we have a web farm environment and we need to persist data across the web farm, for which we intend to use the state server Hi, on the server where State Server will be running, on Services just start the "ASP.NET State Service" service. Then on web.config <sessionState> element in web apps change the mode attribute to "StateServer" and check that stateConnectionString attri...

How to extract session data from MSSQL using "Sql Server" session state mode
I have confronted with some difficulties: I have a task to extract logged user session data from database to collect statistic information from SPPS 2003 (Sharepoint Portal Server) for analyzing purposes.Information I need looks ordinary enough: username, datetimes of user log in and log out, etc..After digging hundreds of articles and docs, I had found out that session object is serialized into database record. It is ok, but I found no decription about where this data can be stored or how can I have access to it.What can I do with it or what should I read for achieving my object? Thanx...

SQL Server State Management on Load Balanced Servers -> Blank Page Issue
I've been working on an application that is on four clustered servers using standard ASP.NET SQL Server state management. The application works fine when a user uses only one server (for the entire duration on the site), but when the user is redirected to a different server (due to a load balancer - F5) upon a post-back of a page, a blank page is displayed (HTML can be found below). Does anyone know what I can due to correct this problem? Here is the HTML I get after a page is posted back by a button event. (If it's not a post back the page always renders correct.) <!DOCTYPE HTML...

Unable to make the session state request to the session state server
Hi all, I'm working on the website http://universityauction.net and I was using session variables using InProc session mode to manage session state. This worked fine until I put the website in a load balanced environment, as inproc sessions get lost when jumping from server to server. I decided to move to a state server mode, so I changed my web.config to: <sessionState             mode="StateServer"             stateConnectionString="tcpip=123.456.7.8:42424"      ...

using sql server session, does it ALWAYS go to sql server?
Testing a simple web app that's configured to save session in SQL SERVER. I have an array of 250000 ints. Session gets saved in 1 page, and retrieved correctly in another, but I only see 1 transaction in profiler. Also have a large complex object size 250KB, and it get's restored instantly, implying it's not coming from the database. From SQL Profiler, I see one transaction to aspstate db when I leave a page that saves session. Shouldn't I see a gaggle of msgs spew by when I save a large object to session??? All comments appreciated! The short answer is yes. The sessi...

Unable to make the session state request to the session state server.
 Hello,           I’m receiving this error when I put my website on production."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 men...

why sql server mode, why state server
I would like to know  when and why to use sql server and when and why to use state server  session statemode.Can anyone help me? Hi, Have a look at this link http://msdn2.microsoft.com/en-us/library/ms178586.aspx I am sure it will help you understand Session modes better. Hope it will help you out Thanks and best regards,Faraz Shah KhanMCP, MCAD.Net, MCSD.Net, MCTS-Win/Web, MCPD-WebBlog imbrue:I would like to know  when and why to use sql server and when and why to use state server  session statemode.Can anyone help me? please read:Understandin...

State service and SQL state server
Hi guys, To use the state service or sql state server functionality do I need to write my classes in any particular way? I've tried enabling the state service and I kept getting errors indicating that my classes were not serializable - how do I make them so? Using the serialize tags etc. seemed very tricky. I would like to use a machanism whereby my session, user (and any other chosen objects) get stored into the database so state management is more robust, but there does not appear to be an obvious way of doing this. Am I to simply write all the code myself, while sticking to a sta...

Unable to make the session state request to the session state server #2
We have recently started receiving these errors in the event viewer. We are using the out of proc state server on the same machine. The errors become more frequent, almost like it snowballs until users cannot work. System Info: Windows Server 2003 Standard SP2 , 4 GB of RAM, IIS 6.0, Asp.Net 2.0. What I know for certain: The state server is started and running Recycling the app pool nor restarting IIS fixes the problem Rebooting the machine DOES temporarily fix the problem. I changed the stateNetworkTimeout from 10 to 20 in webconfig and that had no effect. There is usuall...

Unable to make the session state request to the session state server etc.
We are getting an error message "Unable to make the session state request to the session state server..." sporadically in one of our applications.  We have several applications running on a 4-server web farm, and these applications have been in production for a year, so it is not a problem that the server is not reachable, not started, not addressed correctly, etc etc etc. One of the applications *does* put a lot of large datasets into session state.  Is there a limit on the allowable size of a session/cached object?  Also, the application opens several windows at once, ...

Web resources about - Session on End event if using state server or sql server - asp.net.state-management

Joint session of the United States Congress - Wikipedia, the free encyclopedia
Joint sessions of the United States Congress are the gatherings together of both houses of the United States Congress (the House of Representatives ...

Wall St ends shortened session steady
US markets lack direction in abbreviated post-Thanksgiving trading session.

Perth pub, nightclub opening hours to extend - Sunday Sessions, WA
AS THE east coast of Australia cracks down on late-night drinking, Western Australia is heading in the opposite direction.

Tomas Cubelli arrives in Canberra as Brumbies land blows at AIS boxing session
An immigration hold-up and passport confusion threatened to delay Tomas Cubelli's ACT Brumbies' arrival.

S&P 500 ends flat in holiday-shortened session
The S&P 500 closed little changed on Friday, a fourth straight day of declines, amid weakness in energy and Walt Disney.

GoPro Hero4 Session gets $100 price cut, Xiaomi Yi launches in US
When GoPro introduced the Session action camera in its Hero4 line, it made the mistake of offering the new model at the same price point as the ...

The North Pole is Back in Session
Santa doesn't spread cheer across the globe all by himself. As soon as the first frost is on the mistletoe, hundreds of helpful elves work day ...

Should We Fear Peak Human?: Master Post for Uncharted 2015 Brad DeLong-Peter Leyden Session
**Jennie Eliot**: Your Uncharted Interview Video: To Brad, Peter.... >All links in one place: >* [Full video with highlights](http://reinven ...

TWIABP filmed a live session video for "I Can Be Afraid of Anything," add 2nd NYC show to tour
photo: TWIABP at LPR in August (more by Mimi Hong) The World Is A Beautiful Place & I Am No Longer Afraid To Die is on tour now supporting this ...

Saturday Sessions: Jeff Lynne of "Jeff Lynne's ELO" plays "Turn to stone" - Videos - CBS News
Jeff Lynne is one of the most influential rock musicians and producers ever, and is now leading a 21st-century version of a hit-making powerhouse. ...

Resources last updated: 12/9/2015 3:16:20 AM