Click here to Skip to main content
15,903,033 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello Sir

My Problem is when i Login From Admin and without Logout I Put diffrent Login Url
then happen Page Redirect To Home Page

and when i Click on Browser Back then Session id not Broke and Call My Admin
Login Page so Please hel p Me how to Break Session Id

What I have tried:

Ex- http://localhost:55267/Admin/AdminDashBoard.aspx my First After Login URL

i Put http://localhost:55267/College/CollegeDashBoard.aspx this url instead of above URL

Then it goes to http://localhost:55267/Home.aspx?Flag=2 Home URL

but when i click on Browser back then my First URL Open Session Not Broken So plesae help me how to broke session and do not redirect to First URL it is urgent Please
Posted
Updated 25-May-18 4:47am
Comments
F-ES Sitecore 21-May-18 4:41am    
You probably need to disable caching on the relevant pages. google "asp.net disable caching" for examples.
Member 12183079 21-May-18 13:35pm    
will yo please give me code
Vincent Maverick Durano 21-May-18 19:42pm    
Have you tried searching the term "asp.net disable caching"? It should give you tons of code examples, plus explanation about it.

1 solution

You kill a session like this:
Session.Abandon()

If, however, you just want to empty the session, use:
Session.Clear()

Session.Abandon(); // did not work for me either.

The way I had to write it to get it to work was like this. Might work for you too.
HttpContext.Current.Session.Abandon();
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900