I made a login page and it's working and now i want to set logout status
i'm doing but not success till now .............
please help me..............Thanks a lot of you.........
Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Anuja PawarRank #1,404 · 1.2K reputationPosted Jan 24, 2012, 1:10 AM EST
How to make secure web application
Demonstration:-
onclick="lnk_Click" CausesValidation="false">
Step2-> Now remove the session from cache, To do it, write the following code in page_load event of your master page in which you have logout button.
Demonstration:-
protected void Page_Load(object sender, EventArgs e)
{
Response.Cache.
}
Step3-> Now write the following code in click event of link button
Demonstration:-
protected void lnk_Click(object sender, EventArgs e)
{
Session.Abandon();
Response.Redirect("~/Home.
}
After performing all these steps your logout button will perform fine,
If you want to make more secure of your web application then you need to add Global.asax file in your web application. We define an event in this file that will perform globally and provide security from intruders.
Step1-> *Right click on your web application .
*Add new item.
*Add Global.asax file.
Step2-> Write a function in your Global.asax file as mention below.
void session_start()
{
if (Session["usr"] == null)
{
Response.Redirect("~/Home.
//Here you can write the address of your home page or index page
// Or which you want to make start page.
}
}
Now your web application is secure. If any one paste the url of any page of your web application in the browser but browser will show only home or index page of your web application insteade of appropriate page. This is because your Global.asax file that works globally.
Jimmy Namgail4 reputationPosted Sep 28, 2013, 10:56 PM EDT
Satyapriya NayakRank #47 · 31.5K reputationPosted Jan 22, 2012, 10:47 PM EST
Please refer the below links
http://www.codeproject.com/Articles/210993/Session-Fixation-vulnerability-in-ASP-NET
http://www.codeproject.com/Tips/135121/Browser-back-button-issue-after-logout.aspx
Thanks
Krishna GaradRank #191 · 12.8K reputationPosted Jan 23, 2012, 12:49 AM EST
[ Log In ]
Welcome
[
and in masterpage.cs page create event called Logged_out where you can write the code to log out the user.