Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 802449
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T23:36:15+00:00 2026-05-14T23:36:15+00:00

In my Global.ASAX file i have the following: void Session_End(object sender, EventArgs e) {

  • 0

In my Global.ASAX file i have the following:

void Session_End(object sender, EventArgs e) 
{
    System.Web.HttpCookie isAccess = new System.Web.HttpCookie("IsAccess");
    isAccess.Expires = DateTime.Now.AddDays(-1);
    isAccess.Value = "";
    System.Web.HttpContext.Current.Response.Cookies.Add(isAccess);
}

So every time this method this is called in the application, the following event is logged in the application log as warning:

Event code: 3005 
Event message: An unhandled exception has occurred. 
Event time: 5/25/2010 12:23:20 PM 
Event time (UTC): 5/25/2010 4:23:20 PM 
Event ID: c515e27a28474eab8d99720c3f5a8e90 
Event sequence: 4148 
Event occurrence: 332 
Event detail code: 0 

Application information: 
    Application domain: /LM/W3SVC/2100509645/Root-1-129192259222289896 
    Trust level: Full 
    Application Virtual Path: / 
    Application Path: <PathRemoved>\www\ 
    Machine name: TIPPER 

Process information: 
    Process ID: 6936 
    Process name: w3wp.exe 
    Account name: NT AUTHORITY\NETWORK SERVICE 

Exception information: 
    Exception type: NullReferenceException 
    Exception message: Object reference not set to an instance of an object. 

Request information: 
    Request URL:  
    Request path:  
    User host address:  
    User:  
    Is authenticated: False 
    Authentication Type:  
    Thread account name: NT AUTHORITY\NETWORK SERVICE 

Thread information: 
    Thread ID: 7 
    Thread account name: NT AUTHORITY\NETWORK SERVICE 
    Is impersonating: False 
    Stack trace:    at ASP.global_asax.Session_End(Object sender, EventArgs e) in <PathRemoved>\Global.asax:line 113

Any idea why this code would cause this error?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T23:36:16+00:00Added an answer on May 14, 2026 at 11:36 pm

    It looks like you’re trying to modify cookies during the Session_End event. This won’t work because the end of a session (Session_End) doesn’t correspond to an HTTP request from a user. Instead, it is initiated by ASP.NET 20 minutes (or whatever your session timeout is set to) after the last HTTP request was received from a particular user.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code in my Global.asax file: Protected Sub Application_PreRequestHandlerExecute(sender As Object,
In my Global.asax file I have the following; public static void RegisterRoutes(RouteCollection routes) {
In Global.asax file, I have the following code. config.DependencyResolver = new IoCContainer(unity); In IOCContainer,
I have an Application Object. In Global.asax file i use this: Application[obj] = test;
I have declared an object in my global.asax file as follows. <object Id=WFRuntime RunAt=Server
I have set up ninject on my project in the global.asax file... protected void
Right now, in development I have the following code in the Global.asax.cs file that
In my Global.asax file, I have the following code that deals with with unhandled
Let's say we have 2 projects with following layout Project web global.asax (I thought
I have 2 test and 1 production server. In my global.asax file - I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.