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 817887
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T02:03:48+00:00 2026-05-15T02:03:48+00:00

I programmed a web site, prepared a login mechanism(via textbox, not Login tools), users

  • 0

I programmed a web site, prepared a login mechanism(via textbox, not Login tools), users want to logout, they click logout button. However, my problem is that if users don’t click logout button or close web page or switch another one, How can I understand this situation?
According my mechanism, when users logout ,in DB some insertion and delete operation are making.
I also want to do this with closing page,switch another one.
Thanks.

  • 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-15T02:03:48+00:00Added an answer on May 15, 2026 at 2:03 am

    It sounds like you’re doing a DB operation on logout, and when people just navigate away without clicking the logout button, the code doesn’t fire.

    In your global.asax, take a look at session_end. Maybe you can put your operation in there.

    protected void Session_End(Object sender, EventArgs e) 
    { 
        // Your code goes here. Since your logout code probably relied on the user being
        // logged in, you might end up checking Request.IsAuthenticated here. Why? Because
        // this event fires any time a session ends -- even if the user is not logged in! 
    }
    

    Note that if you use this, it actually fires when the IIS session ends, not when the browser closes. By default the session times out after 20 minutes of inactivity.

    Once you implement this, you could have your logout page call Session.Abandon, which will trigger Session_End. That seems clean to me.

    Here’s an MSDN link with some more details on session events: http://msdn.microsoft.com/en-us/library/ms178583.aspx

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

Sidebar

Related Questions

I am creating a web site for my church. Because they know of no
I'm not a programmer, but I've done all the customizations for my web shop
I'm a programmer, I can build a web site, but the pages looks ugly.
I'm not a programmer, but I did manage to develop our company site in
Hello I want to create a simple blog where users can post comments, but
I have found this web site really helpful since everybody helps here with the
I'm working on a radio web site project based on Codeigniter. Here is layout
Before I begin, I must warn you that I'm not much of a web
I am a new Asp.net Mvc programmer and I am developing a web site
i programmed a Chat-Program like ICQ with C# and WCF. Now i want to

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.