0

When clicking logout button I just used :

response.redirect("login.aspx");

But the thing is when I click back in browser, it is logging in without entering passwords.

Secondly, my question is how to end this session.

My code snippet is here,

 <li><a href="Default.aspx" runat="server" onclick="LogoutClicked()"><span class="glyphicon glyphicon-log-out"></span> Log Out</a></li>

Thirdly, that is a asp.net page using C#, but I just used an anchor tag that just redirects.

3
  • Are you use WebForms or MVC? Commented Nov 15, 2016 at 7:45
  • Please note that nothing is urgent here. Commented Nov 15, 2016 at 9:51
  • No.. tats a webform Commented Nov 15, 2016 at 12:17

1 Answer 1

3

You need to abandon session so all your sessions should be destroyed after logout Try this

Session.Abandon(); Respone.Redirect("Your Url");

Sign up to request clarification or add additional context in comments.

2 Comments

Onclick () function is not available for anchor tags. I cant araise that in code behind however
Where you put this line response.redirect("login.aspx"); just above of it use Session.Abandon();

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.