Click here to Skip to main content
15,897,187 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
Hi,

if i visited away from admin page (after admin login), i want the (admin page to expire and not be able to return back to that page), so redirect to login page again. is that possible without dealing with browser buttons such as back button and refresh button?

Thanks,
Posted
Comments
F-ES Sitecore 17-Dec-15 6:06am    
You need to disable caching on your admin page. Google "disable page caching asp.net" for code examples of how to do this.
Sinisa Hajnal 17-Dec-15 6:15am    
You could remove token that allows you access on page unload. (by token, I mean whatever mechanism you use to login)
Afzaal Ahmad Zeeshan 17-Dec-15 13:00pm    
In such cases, I would recommend using Session variables. Only keep the session active when he is on the page, even if he redirects from the page, remove the variable.
Sergey Alexandrovich Kryukov 17-Dec-15 16:27pm    
Even if you don't deal with caching and all those "browser buttons" you can get correct behavior based on user authentication which is always based on the server side and does not depend on what one has in cache or simply in a second Browser window. It does not mean that the users sees some page which is not supposed to be viewed because current access does not allow it. After all, this is unavoidable — anyone can always have a copy of any page. :-)
What's important that any action based on HTTP request on this page will be disabled for a non-authenticated user. Isn't it simple?
—SA

1 solution

Sometime ago when i faced the same kind of issue, following StackOverflow post helped me alot....

Its tested and implemented in multiple projects(both WebForms and MVC) by me and works like a charm.

Please do have a look at the following for complete details.How to Expire a session if user leaves an interface.....


Hope it will help. :)
 
Share this answer
 

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