473,406 Members | 2,710 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

global.aspx and session_end event

When I call the session.abandon() method, it calls the session_end event.
When a user closes the browser or clicks the log off button, I can dispose
of objects and abandon the session cleaning. But, when a user either
navigates away from the web app and when the session timesout, the
session_end event does not seem to fire. Or when else can I dispose of
objects? Or is there an event I can you that is fired when a user navigates
away from the web app?
Aug 16 '06 #1
8 5750
After 20 minutes or whatever your IIS session timeout variable is the session_end event should be called.
If doesn't seem to be be working then check your IIS settings.

mnichols

Roger wrote:
When I call the session.abandon() method, it calls the session_end event.
When a user closes the browser or clicks the log off button, I can dispose
of objects and abandon the session cleaning. But, when a user either
navigates away from the web app and when the session timesout, the
session_end event does not seem to fire. Or when else can I dispose of
objects? Or is there an event I can you that is fired when a user navigates
away from the web app?
Aug 16 '06 #2
found out, the event is being called, but I want to dispose (or clean up)
objects that was used within the web app. put the call within a try and wrote
to a event viewer. But, when I call the dispose method, it returned that the
"Object reference not set to an instance of an object." But, it did not
really release cleanly. Cause if user clicks on the Log off button on the web
app, it will call the dispose method and it shut down all dependent objects.
Any ideas around this?

"mnichols" wrote:
After 20 minutes or whatever your IIS session timeout variable is the session_end event should be called.
If doesn't seem to be be working then check your IIS settings.

mnichols

Roger wrote:
When I call the session.abandon() method, it calls the session_end event.
When a user closes the browser or clicks the log off button, I can dispose
of objects and abandon the session cleaning. But, when a user either
navigates away from the web app and when the session timesout, the
session_end event does not seem to fire. Or when else can I dispose of
objects? Or is there an event I can you that is fired when a user navigates
away from the web app?
Aug 16 '06 #3
Sounds like a garbage collection issue. Somehow you need to determine if the objects have already been released or not and then when they are released that they are released completely.
The LogOff button should trigger a Session.Abandon which is what session_end should do. If there are subtle differences then I am sot sure I can help.
Maybe someone else has beeter insights.

mnichols
Roger wrote:
found out, the event is being called, but I want to dispose (or clean up)
objects that was used within the web app. put the call within a try and wrote
to a event viewer. But, when I call the dispose method, it returned that the
"Object reference not set to an instance of an object." But, it did not
really release cleanly. Cause if user clicks on the Log off button on the web
app, it will call the dispose method and it shut down all dependent objects.
Any ideas around this?

"mnichols" wrote:
>After 20 minutes or whatever your IIS session timeout variable is the session_end event should be called.
If doesn't seem to be be working then check your IIS settings.

mnichols

Roger wrote:
>>When I call the session.abandon() method, it calls the session_end event.
When a user closes the browser or clicks the log off button, I can dispose
of objects and abandon the session cleaning. But, when a user either
navigates away from the web app and when the session timesout, the
session_end event does not seem to fire. Or when else can I dispose of
objects? Or is there an event I can you that is fired when a user navigates
away from the web app?
Aug 16 '06 #4
yes, my logoff functionality is working. What I am trying to do if if user
just navigates away from the web app without clicking the log off button.
Cannot always assume the users is going to follow instructions to the dot.
so, when the session timeouts, it does call the session_end event, but, does
not dispose of my objects cleanly. And that is what I am trying to figure out
now. Hope you or someone might have some insight.

"mnichols" wrote:
Sounds like a garbage collection issue. Somehow you need to determine if the objects have already been released or not and then when they are released that they are released completely.
The LogOff button should trigger a Session.Abandon which is what session_end should do. If there are subtle differences then I am sot sure I can help.
Maybe someone else has beeter insights.

mnichols
Roger wrote:
found out, the event is being called, but I want to dispose (or clean up)
objects that was used within the web app. put the call within a try and wrote
to a event viewer. But, when I call the dispose method, it returned that the
"Object reference not set to an instance of an object." But, it did not
really release cleanly. Cause if user clicks on the Log off button on the web
app, it will call the dispose method and it shut down all dependent objects.
Any ideas around this?

"mnichols" wrote:
After 20 minutes or whatever your IIS session timeout variable is the session_end event should be called.
If doesn't seem to be be working then check your IIS settings.

mnichols

Roger wrote:
When I call the session.abandon() method, it calls the session_end event.
When a user closes the browser or clicks the log off button, I can dispose
of objects and abandon the session cleaning. But, when a user either
navigates away from the web app and when the session timesout, the
session_end event does not seem to fire. Or when else can I dispose of
objects? Or is there an event I can you that is fired when a user navigates
away from the web app?
Aug 16 '06 #5
>From what I understand with the discussion until now, you have some
code that cleans up your objects in user logoff function, but the same
code is not working if you place it in Session_End event handler. Is
that right?

If not, If users are simply navigating away from your application
without clicking logoff, how are you handling the object cleanup?
Remember server has no idea as what user does on the browser, unless he
sends a HTTP request

P.S: Session_End would not have access to HTTP request and response
handlers

Roger wrote:
yes, my logoff functionality is working. What I am trying to do if if user
just navigates away from the web app without clicking the log off button.
Cannot always assume the users is going to follow instructions to the dot.
so, when the session timeouts, it does call the session_end event, but, does
not dispose of my objects cleanly. And that is what I am trying to figure out
now. Hope you or someone might have some insight.

"mnichols" wrote:
Sounds like a garbage collection issue. Somehow you need to determine if the objects have already been released or not and then when they are released that they are released completely.
The LogOff button should trigger a Session.Abandon which is what session_end should do. If there are subtle differences then I am sot sure I can help.
Maybe someone else has beeter insights.

mnichols
Roger wrote:
found out, the event is being called, but I want to dispose (or clean up)
objects that was used within the web app. put the call within a try and wrote
to a event viewer. But, when I call the dispose method, it returned that the
"Object reference not set to an instance of an object." But, it did not
really release cleanly. Cause if user clicks on the Log off button on the web
app, it will call the dispose method and it shut down all dependent objects.
Any ideas around this?
>
"mnichols" wrote:
>
>After 20 minutes or whatever your IIS session timeout variable is the session_end event should be called.
>If doesn't seem to be be working then check your IIS settings.
>>
>mnichols
>>
>Roger wrote:
>>When I call the session.abandon() method, it calls the session_end event.
>>When a user closes the browser or clicks the log off button, I can dispose
>>of objects and abandon the session cleaning. But, when a user either
>>navigates away from the web app and when the session timesout, the
>>session_end event does not seem to fire. Or when else can I dispose of
>>objects? Or is there an event I can you that is fired when a user navigates
>>away from the web app?
Aug 16 '06 #6
You need to be more specific about what "objects" need to be disposed (or
even if that is necessary), and be aware of the fact that they may already be
gone anyway.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Roger" wrote:
yes, my logoff functionality is working. What I am trying to do if if user
just navigates away from the web app without clicking the log off button.
Cannot always assume the users is going to follow instructions to the dot.
so, when the session timeouts, it does call the session_end event, but, does
not dispose of my objects cleanly. And that is what I am trying to figure out
now. Hope you or someone might have some insight.

"mnichols" wrote:
Sounds like a garbage collection issue. Somehow you need to determine if the objects have already been released or not and then when they are released that they are released completely.
The LogOff button should trigger a Session.Abandon which is what session_end should do. If there are subtle differences then I am sot sure I can help.
Maybe someone else has beeter insights.

mnichols
Roger wrote:
found out, the event is being called, but I want to dispose (or clean up)
objects that was used within the web app. put the call within a try and wrote
to a event viewer. But, when I call the dispose method, it returned that the
"Object reference not set to an instance of an object." But, it did not
really release cleanly. Cause if user clicks on the Log off button on the web
app, it will call the dispose method and it shut down all dependent objects.
Any ideas around this?
>
"mnichols" wrote:
>
>After 20 minutes or whatever your IIS session timeout variable is the session_end event should be called.
>If doesn't seem to be be working then check your IIS settings.
>>
>mnichols
>>
>Roger wrote:
>>When I call the session.abandon() method, it calls the session_end event.
>>When a user closes the browser or clicks the log off button, I can dispose
>>of objects and abandon the session cleaning. But, when a user either
>>navigates away from the web app and when the session timesout, the
>>session_end event does not seem to fire. Or when else can I dispose of
>>objects? Or is there an event I can you that is fired when a user navigates
>>away from the web app?
Aug 16 '06 #7
From what I understand with the discussion until now, you have some
code that cleans up your objects in user logoff function, but the same
code is not working if you place it in Session_End event handler. Is
that right?
That is correct. If they navigate away, the session_end event is called when
the session has timed out. But, in the function, when I attempt to call the
dispose method of the object, it throws an error "Object reference not set to
an instance of an object." But, I know it did not dispose properly cause when
the object is called it starts a process inthe task manager I can monitor. If
I press the log off button, I see the process clear out of the task manager.
But, if the timeout is fired, the process is still running on the task
manager.

"Kumar Reddi" wrote:
From what I understand with the discussion until now, you have some
code that cleans up your objects in user logoff function, but the same
code is not working if you place it in Session_End event handler. Is
that right?

If not, If users are simply navigating away from your application
without clicking logoff, how are you handling the object cleanup?
Remember server has no idea as what user does on the browser, unless he
sends a HTTP request

P.S: Session_End would not have access to HTTP request and response
handlers

Roger wrote:
yes, my logoff functionality is working. What I am trying to do if if user
just navigates away from the web app without clicking the log off button.
Cannot always assume the users is going to follow instructions to the dot.
so, when the session timeouts, it does call the session_end event, but, does
not dispose of my objects cleanly. And that is what I am trying to figure out
now. Hope you or someone might have some insight.

"mnichols" wrote:
Sounds like a garbage collection issue. Somehow you need to determine if the objects have already been released or not and then when they are released that they are released completely.
The LogOff button should trigger a Session.Abandon which is what session_end should do. If there are subtle differences then I am sot sure I can help.
Maybe someone else has beeter insights.
>
mnichols
>
>
Roger wrote:
found out, the event is being called, but I want to dispose (or clean up)
objects that was used within the web app. put the call within a try and wrote
to a event viewer. But, when I call the dispose method, it returned that the
"Object reference not set to an instance of an object." But, it did not
really release cleanly. Cause if user clicks on the Log off button on the web
app, it will call the dispose method and it shut down all dependent objects.
Any ideas around this?

"mnichols" wrote:

After 20 minutes or whatever your IIS session timeout variable is the session_end event should be called.
If doesn't seem to be be working then check your IIS settings.
>
mnichols
>
Roger wrote:
>When I call the session.abandon() method, it calls the session_end event.
>When a user closes the browser or clicks the log off button, I can dispose
>of objects and abandon the session cleaning. But, when a user either
>navigates away from the web app and when the session timesout, the
>session_end event does not seem to fire. Or when else can I dispose of
>objects? Or is there an event I can you that is fired when a user navigates
>away from the web app?
>

Aug 16 '06 #8
"Roger" <Ro***@discussions.microsoft.comwrote in message
news:46**********************************@microsof t.com...
That is correct. If they navigate away, the session_end event is called
when
the session has timed out. But, in the function, when I attempt to call
the
dispose method of the object, it throws an error "Object reference not set
to
an instance of an object." But, I know it did not dispose properly cause
when
the object is called it starts a process inthe task manager I can monitor.
If
I press the log off button, I see the process clear out of the task
manager.
But, if the timeout is fired, the process is still running on the task
manager.
See Peter's reply...

Do the following:

1) Set your Session timeout to 1 minute

2) Set a breakpoint at the very top of your Session_End method

3) Start your web project in debug mode (Ctrl-F5)

4) FROM ANOTHER BROWSER WINDOW, access your site

5) Log in as normal

6) Don't log out cleanly - instead, just close the browser

7) Wait patiently for 60 seconds until the Session_End fires - now step
through, identify the problem and fix it... :-)
Aug 16 '06 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: raj | last post by:
Hi, I am facing a problem of automatic session timeout problem and automatic session_end event fired. Case1: As I have analyzed I get to know that the default session timeout is 20 in...
5
by: Steve M | last post by:
Why are my sessions lasting so long? I have them set to 20 minute timeout in config file? The Session_End event is getting called an hour or more sometimes--well after the user has stopped...
3
by: Mark Field | last post by:
Assuming that IIS is not restared, and that the web server is not restarted, should the "session_end" event in the global file ALWAYS fire or will there be times when it will not fire? protected...
7
by: T. | last post by:
Does the Session_End event actually fire? I am building an ASP.NET application, and so far I have an HTML page and a single asp page. The HTML is the home page. I have code in the Global.asax...
11
by: OldProgrammer | last post by:
All the documentation and discussion I have read indicate that the Session_End is not supposed to fire unless you are in "inProc" Session state mode, and then only on Session Timeout or at Session...
5
by: news.microsoft.com | last post by:
We are logging many events on our application but cant seem to discover how to determine who the user was in the session end event, as any session storage seems to have disapeared at the point at...
1
by: =?Utf-8?B?YnJlbnQ5NjA=?= | last post by:
Environment: ASP.NET 2.0, SQL Server 2005, C#, Visual Studio 2005 In my Session_End event, I am executing a stored procedure to update a database table that is used to log user sessions. When...
2
by: jamal idba | last post by:
Hello, I'm working with web developper express edition. I have a global.asax. I have a web application all ready. The problem is : Session_End event is never raised. I have in my web.config file :...
12
by: =?Utf-8?B?QWxleCBNYWdoZW4=?= | last post by:
Hi. I am trying to maintain a list of people who are currently "online" in SQL. I do this by adding a simple entry to a simple PeopleOnline table whenever someone logs in to my site. If they...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.