473,407 Members | 2,306 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,407 software developers and data experts.

What can be done in Session_End()?

What can be done in Session_End()?

Can I get something from Session[] in this handler?

My Global.asax.cs is below

using System;
using System.Collections;
using System.ComponentModel;
using System.Web;
using System.Web.SessionState;

namespace SD
{
/// <summary>
/// Summary description for Global.
/// </summary>
public class Global : System.Web.HttpApplication
{
protected void Application_Start(Object sender, EventArgs e)
{

}

protected void Session_Start(Object sender, EventArgs e)
{
HttpContext.Current.Session["QWERTY"] = 9;
}

protected void Application_BeginRequest(Object sender, EventArgs
e)
{

}

protected void Application_EndRequest(Object sender, EventArgs e)
{

}

protected void Application_AuthenticateRequest(Object sender,
EventArgs e)
{

}

protected void Application_Error(Object sender, EventArgs e)
{
int i = 0;

}

protected void Session_End(Object sender, EventArgs e)
{
int i = (int)HttpContext.Current.Session["QWERTY"];
i++;
}

protected void Application_End(Object sender, EventArgs e)
{

}
}
}

When Session_End() is raised HttpContext.Current.Session gives me
NullReferenceException. I have no other plkaces where my
session-hosted var can be modified. Developing platform - VS2003 +
W2000 Server SP3
Nov 18 '05 #1
0 1450

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...
9
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; ...
2
by: Kian Goh | last post by:
Hi there, Just wonder what factor actually determine a session to end? What happen a user close the browser or switch to other website? Does the session end immediately or 20 minutes later?...
7
by: Imran | last post by:
Hi.., I tried to execute some code in the Sub Session_End in the Global.asax, but its not working. I am developing the asp.net application on Windows Server 2003 and IIS6. Tell me whats the...
0
by: Savin Igor | last post by:
What can be done in Session_End()? Can I get something from Session in this handler? My Global.asax.cs is below using System; using System.Collections; using System.ComponentModel; using...
0
by: PCK | last post by:
Thanks in advance for any help.... I have an application that uses the Session_End to perform some data access against our database. This works as expected when a session times out. However,...
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...
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...
5
by: Ron J | last post by:
I would like to keep track of users when they are 'on'. On Session_Start I can write a DB record about them, but there does not seem to be session variable information during the Session_end event...
8
by: vickyl | last post by:
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...
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: 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
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...
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
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...
0
agi2029
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.