Hi,
I've been having this problem for the pas few days so i thought i'd post and see if anyone could help.
I have an application that has code to delete file in Session_end. When i start a session and then do nothing in the browser for the timeout amount of time, session_end fires and the code works....the files get deleted. However, if i close the browser and wait the same amount of time (or longer) Session_End never fires. I know that closing the browser doesn't call session_end.... i am actually waiting the timeout amount of time but Session_end just never fires.....Is there something about Session_end and closing browsers that i am not aware of?
Thanks in advance to anyone who can help :)
vicky
8 1791 Plater 7,872
Recognized Expert Expert
Session_End() should fire after the timeout time, regardless of if browser is left open or is closed.
Is your Session type set to "InProc" (I think that's the default)
yes it is InProc
this seems very bizarre to me....
this is the code i have in my session_end. i am testing on my machine and no one else has access so session.count should always be 1....which it is when i keep the browser open....but seems to change when i close the browser:
Sub Session_End(ByV al sender As Object, ByVal e As EventArgs)
If session.Count = 1
Dim s As String
Dim path As String = HttpRuntime.App DomainAppPath
For Each s In System.IO.Direc tory.GetFiles(p ath + "\TempReference Files\")
System.IO.File. Delete(s)
Next s
End If
End Sub
Plater 7,872
Recognized Expert Expert
Why do that at every session_end(), wouldn't that mess up anyone else trying to use the stite?
You could do it in Application_End ()?
EDIT:
As for why the session count goes up, when you close your browser and then goto website again, you will get a new session, so the count will go up.
well that's why i check if any other sessions are open....if there are more than one it doesn't delete (at least that's what i'm trying to do).
also, at the moment i have my timaout set at 1 minute for testing purposes and i'm not opening any other browsers.....so there should only always be 1 session open at a time
Plater 7,872
Recognized Expert Expert
As far as my testings have shown, when the last session "ends", the Application_End () event fires
ok i may have misunderstood the session_end.... i was under the impression that it fired every time a session would timeout....not just the last one
Plater 7,872
Recognized Expert Expert
ok i may have misunderstood the session_end.... i was under the impression that it fired every time a session would timeout....not just the last one
No you are correct, it *should* fire for every session that ends (as long as session is listed as "InProc"). However after the last session has ended, my application seems to call the application_end () function and shut itself down.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Kenn Ghannon |
last post by:
I've got an ASP.NET page with a counter subtraction routine in the
Session_End method in the Global.asax.cs:
protected void Session_End(Object sender, EventArgs e)
{
ulong curUsers;
Application.Lock();
|
by: Bonj |
last post by:
Hi
I have an ASP.NET application which implements a server-side charting
solution, for this it needs to generate .gif files which are then sent to
the browser via a literal which has its text set to "<img src=\" +
graphfilename + \"/>. This is all working beautifully, however all these
..gif files are going to build up on the server and are going to need
deleting. I tried putting some code in the Session_End function in
global.asax, but...
|
by: Chris |
last post by:
Hi,
I entered some logging-stuff in global.asax :
namely in Application_Start(), Application_End(), Session_Start() , etc
....
When I start the ASP.NET app from within Visual Studio does it Log very
nicely
Application_Start,
Application_BeginRequest ,
|
by: Guadala Harry |
last post by:
Just wondering if Session_End *always fires* for every Session. I know that
IIS times out sessions after a default 20 min (unless changed) and there's
no way to know when a user actually closed a browser (unless I provide a
"log out" button that kills the session explicitly, and we can't guarantee
the user will click on that). What I am wondering if there are there
well-known/documented circumstances under which Session_End will NOT fire...
|
by: Raed Sawalha |
last post by:
in our multiple applications solutions which is as follows:
Parent :
Global.ascx
Logout.aspx
SubProj1
No Global or logout
SubProj2
No Global or logout
| |
by: Annie |
last post by:
Hi guys,
I just want to do some clean up in the Session_End at Global.aspx.
However, if the user closes the browser window that event is not fired.
how can I call explicity protected void Session_End(Object sender, EventArgs
e)
when the user closes the browser window?
|
by: Calvin Willman |
last post by:
ASP.NET 2.0, Visual Web Developer Express
I've written a web app, which creates a Gif to display on the page. I name
it .gif, and only want it to last as long as the session, so I've
included
File.Delete() in the Session_End event, but this never seems to
run. I've set break points which are never reached...
I've added <sessionState mode="InProc" /> to the web.config file...
|
by: Bruno |
last post by:
We are attempting to automatically log users off from the Session_End event
in global.asax and set some values on session_start. It is not a critical
task, more of a housekeeping task so that we know if users have closed down
their browsers without logging off first. However, although the code seems
to run OK on our development servers (WinXP ASP.NET v. 1.1, SQL Server 2000,
IIS6), they don't seem to be firing on the live server despite...
|
by: Roger |
last post by:
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...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
| |
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |