473,387 Members | 1,561 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,387 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 1449

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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.