Solved

session_end() of global.aspx does not execute on session.abandon() in vb.net code behind

Posted on 2004-10-07
3
1,005 Views
Last Modified: 2008-02-20
hello everybody,

friends i am working on an application where i have to reset a flag in databse by a sql query whenever the session of a user is destroyed due to timeout or proper logout, so i used session.abandon() command in vb.net code behind and write the following code in session_en() function of global.aspx .


-----------------------------------------------------------------------------------------------
 Sub Session_End(ByVal sender As Object, ByVal e As EventArgs)

        Dim connLogin As SqlConnection = New SqlConnection
        connLogin = New SqlConnection(ConfigurationSettings.AppSettings("ConnectionString"))
        If connLogin.State = ConnectionState.Closed Then
            connLogin.Open()
            Dim x = 17 'Session("IID")
            Dim cmdUpdate As SqlCommand = New SqlCommand("update status set Flag='1' where IID='" & x & "'", connLogin)
            cmdUpdate.ExecuteNonQuery()
            connLogin.Close()
            Context.Response.Write("database restored")
        Else
            Context.Response.Write("database cant be restored")
        End If

End Sub
-----------------------------------------------------------------------------------------------------

but any part of this function is not executed at all whenever session expires.

i have also given the session timeout value to 2 minutes in web.config file.

please help that exactly when and how this function can be executed as i need it at many more places.

thanks in advance.
0
Comment
Question by:anugrah
3 Comments
 
LVL 33

Expert Comment

by:raterus
ID: 12248209
0
 

Accepted Solution

by:
softsolvers earned 90 total points
ID: 12256024
you can't see any context.response.write("string ")   output in session_end() otherwise your function is working fine . i have checked it .

thanks
0
 
LVL 1

Author Comment

by:anugrah
ID: 12256033
ya , softsolvers , thanks a lot your soluted helped me out of your problem
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull conte…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now