Security :: How To Force A User To Logout On Back Button
Nov 15, 2010How can I force a user to logout when he press the browser back button ?
View 11 RepliesHow can I force a user to logout when he press the browser back button ?
View 11 Repliesafter user loggs out if he clicks the browsers back button then users had to be redirected to login page
doenst matter how many time the user clicks on back button take him to login page
how to achieve this let me know
I need to disallow the user from clicking the back button after they have login to the web site.
I have to stop them from going back after thay have logout from the web site.
I find out online that this can be done
but once the javascript function is turn off it does not work.
[Code]....
Is there any way to really stop go back function in the above situation? I wonder how the bank commercial web site handle this kind of situation?
how to avoid viewing the last page visited by the user after logging out.
View 2 RepliesI am using ASP.NET, the web page is abandoning and clear session when a user click logout link but they click the back button and it is still showing the previous page. How can it prevent the previous page after logout? on Logout.aspx load im using this code
Session.Clear();
Response.Buffer = true;
Response.ExpiresAbsolute = DateTime.Now.AddDays(-1D);
Response.Expires = -1500;
Response.CacheControl = "no-cache";
//----- Second Technique : To Stop Caching of Secure Pages.
Response.Cache.SetCacheability(HttpCacheability.NoCache);
FormsAuthentication.SignOut();
if (Session["UserName"] == null)
{
Response.Redirect("login.aspx");
}
Session.Clear();
I used Membership provider in my application. when i am creating new user by filling the details and adding role after the submit button it force the current user to logout and re-login using the current user which I created.Â
Like as a admin I created the user irshad, it admin to logout and again re-logged in with the current user irshad.
When I click Logout page redirect to Login page but when click to browser arrow back then it will goes back, I want to after Logout cannot going to back page...
View 1 RepliesI have written custom code for login and logout...When use clicks on logout button the current session is closed and user is redirected to a login.aspx page...The problem is that when a user click a back button on internet explorer it the previous page he was navigating is shown to him...(altough he cant perform any operation as session is null and their is condition in page load that if session is null user should be redirected to login page)May i have to clear cache of client ??
View 3 RepliesI have 2 master pages Default.aspx is from Site.Master and some more pages that are from Admin.Master, I have used the code that to prevent the user from going back to previous pages after logout.
 Here is my code
function preventBack()
{
window.history.forward();
}
setTimeout("preventBack()", 0);
window.onunload = function () { null };
The problem I am facing Admin.
Master page i.e I have Home.aspx, AboutUs.aspx,Admin.aspx,AddItem.aspx I was unable to navigate between those pages also. how to solve this. I have tried other methods also, but still facing same problem.Â
When I click signout I am redirecting to home page but when I click browser back button it is redirecting to previous page how to eliminate this......
View 1 RepliesIn the logout link button click event I have cleared the session variables.I am checking these session variables for null values at each page's load event.If it has the null value redirecting them to the login page.But the problem is whenever I click the browser back button,the page_load event won't get called.For that I have cleared the the browser cache history.
View 2 Replieshow to prevent back button after logout in asp.net
View 1 RepliesI have a web application build in asp.net and using a custom membership provider for authentication and authorization. Everything works fine except when the user click on the logout link to log out of the application and being redirect to a default cover page, if the use click on the BACK BUTTON on their browser, it will actually go back to where they were before and the data will still show up.
Of course they can't do anything on that page, click on anything link they will be redirect to a login page again. But having those information display is making a lot users confused.
i am just wondering if there is any way i can either clear the browser's history so use can't go BACK, or when they click on the back button and have them redirect to the login page.
I have a website built in ASP.net 3.5, using WinForms and AjaxToolKit. I have encountered a lost/corrupt session issue while using Internet Explorer 8.
Scenerio:
1 IE8 Browser Open, 1 Tab
--------------------------------------
1. Login, Redirect to Landing, Logout - WORKS AS EXPECTED
2. Login, redirect to Landing, Close Window, Open Window, Logged-in already - WORKS AS EXPECTED (remember me enabled by default in code)
1 IE8 Browser, 2 Tabs
--------------------------------------
1. Login, Redirect to Landing, Open new tab, paste Landing page URL, Landing renders. - WORKS AS EXPECTED
- Logout from Tab 2, Tab 1 logs out after AJAX update. - WORKS AS EXPECTED
- Login from Tab 1, Redirects to Landing, then Redirects back to Login page - ISSUE
[code]...
2. Close Window,Login,Redirect to Landing - WORKS AS EXPECTED
2 IE8 Browser, 1 Tab
--------------------------------------
1. Open 2 IE windows
2. In Window 1, Login, Redirect to Landing, then Redirects back to Login. - ISSUE
- Window 2 Paste Landing page URL, Landing page renders - ISSUE, STRANGLY NOW WORKS
[code]...
This issue seems to only happen when I have multiple tabs open,or multiple rwssers open.Firefox and Chrome does not reproduce this issue and works as expected.How do I make sure the Cookie/Session is being handle correctly in IE8?
Here is my Login Auth:
[Code]...
Web.Config
[Code]...
Server 2008r2
Seesion State:
Cooke Settings: Mode: Use Cookies;
Broswer IE8
Default settings
c# - How do I force full post-back from a button within an UpdatePanel?
View 3 RepliesI am using asp.net 3.5 and use master pages for most of the website. I need to make sure that users after they logout are not able to use the back button to see in cache data.
View 4 Repliesdisable back button on my asp.net application. I Should not be able to go back to my previous page after I logout.
View 2 RepliesI've created a Sign Out link on my page, just like the one you see on the top right hand corner of this forum.
This is the code i use :
<asp:HyperLink NavigateUrl="~/Login.aspx" ID="hypSignOut" runat="server" Text="Sign Out"></asp:HyperLink>
However, after signing out, I click the back button on my browser, I can still go back into the site. How do I prevent this?
In the site I am building we have standard users and superusers. A superuser can delete another user from the system and this should result in that user being logged out (if he/she is currently logged in). We use the Membership provider. Or actually the superuser doesn´t delete the other user completely but instead sets his/her as inActive by following code:
[code]...
But, that should not matter... What I want to know is how to make the affected user being logged out. I don´t need a popup or anything to be shown to the other user that he/she is just logged out, it is enough to check if that user is logged in when he/she tries to move to another page on my site.
i'm using ASP.NET membership for a silverlight application that makes use of Wcf Ria Services.
my problem is that i don't want multiple logins on the same account and i need to logout the user when he logs in on another machine. (I don't want the account to be used by many people at the same time, and the last who logs in must kick out everyone else)
if a user wants to clear their personal information from a page after clicking on a button that they be re-directed to the ASP Login page. This code needs to be developed using Java Script because I want the user to confirm with a confirmation box that they intended to clear their info. I have found resources on MS that pointed to referencing the "System Web Extension" within the Web Config file shown below, which enables Java Script to be able to reference the Authentication Service classes. I am also calling the function show_confirm in the button onclick event to process the message box response.
I also need to redirect a user back to the Login page within this same show_confirm() function without pointing directly to the URL, but instead to the folder where the page is locateded like in VB Server Redirect if possible.
The error message I receive when I run this code is: Microsoft JScript runtime error: 'sys' is undefined.
Shawn
[Code]....
[Code]....
I am having a probem when logout from my website.When i copy the URL page which is the page after login,and paste it again in browser,i can direct it to the page even though i alr logout. I not using any buit in asp control,and the logout button link that i create is place at Master Page.
View 1 RepliesBelow code is working fine, it will logout user in after 1 minute, since I have another login control in Home page, I was trying to add another line:
<forms loginUrl="Default.aspx" timeout="1"/>, but gives me error: The element <forms> may only appear once in this section,
so the timeout in the webconfig can only have one page for the function?
[Code]....
i am trying to save last user logon on database,the event will done when user logout or close browser
i tried to call web_service on javascript but in vain,the javascript doesnt see the webService,but i added reference to ScriptManager
[Code]....
i got username from the cookie,i access the DB to update his table.
the question as iam beginner on asp
where and when to use this method,when to cupture the user's web browser close,
how to do this in aspx.cs code behind "iam not good at JS"
and i want to know? when the user close the browser or page? am i still connecting with him to make changes as his account(cookie)?
In my web application when I start my webpage from Visual Studio the URL to my ligin page looks like this:
[Code]....
And when logging out, the following are executed:
[Code]....
Question: I need to have the return URL set to Default.aspx as it is when logging in the first time. Does anyone know how I can achieve that?