Quantcast
Channel: Security
Viewing all articles
Browse latest Browse all 4737

check if session.sessionid is null

$
0
0

i need to update data in the database , if session.sessionid is null , i have modified the global.asax , to the below , but still getting an error stating : method name expected .

void Session_End(object sender, EventArgs e)
    {
        // Code that runs when a session ends.
        // Note: The Session_End event is raised only when the sessionstate mode
        // is set to InProc in the Web.config file. If session mode is set to StateServer
        // or SQLServer, the event is not raised.

        SqlConnection con = new SqlConnection("Data Source=.\\sqlexpress;Initial Catalog=geroges;Integrated Security=True;Pooling=False");
        con.Open();
        SqlCommand cmdlogin = new SqlCommand("UPDATE Table3 SET Logged='False' WHERE "+Session.SessionID = null() , con);
        cmdlogin.ExecuteNonQuery();
        cmdlogin.Dispose();
        con.Close();

        
        
        
    }

help please with that !!


Viewing all articles
Browse latest Browse all 4737

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>