Security :: Determine User Signout, Or Page Close?
Feb 26, 2010
Im working on a website where users can log into a members area, inside this area they will be able to communicate with other members.
In order to keep an accurate list of who is online and who is not, I would need to update a IsOnline field in my database when they log on and when they exit my website..
The login part is easy, but how can I determine if someone is leaving my website to go to another, or closing the browser.
I need to realize for administrator ability to block/unblock user. I do it by following way:
[Code]....
but if this user is already logged that these changes will be only during next login. I need to throw this user to login page in next his request. I have 2 way:
I'm using Forms Authentication. Is there a way to determine whether a page (or request) required authentication or not? My site has logged-in areas, and logged-out areas (all set in web.config under authorization sections), and I'd like a good way to know if asp.net required authentication to be set or not.
I would like to create a webpage which can handle user events like page navigation and page close. And also I would like to handle the event on server-side coding.
I've implemented this string format in my NavigateUrl to pass a dynamic querystring depending on the clicked item!
but you see the first part in the string format where it says "~/PLayer.aspx" i want the user control to automatically change this part according to where it's placed!
I have a Default(contains the sign-out button) and Login page, once the user is not authenticated, it will always redirect the user to login page.
So the scenario is when the user hit the sign-out button it will redirect him to the login page which is good. My problem is, when the user hits theprevious or back button from the login page,it will still read the authorization cookies and redirect him to the default page. which should not be the case. the user should be redirected to login page when authentication is invalid.
I've read some solutions on the net, but still it doesn't work for me. below are the codes I've used for my sign-out function
[Code]....
By the way, when the user is authenticated, the previous or back button is available/enable for the user.
Ok so I am working on a control that when the user comes from a specific website then it will be a certain action. What would be the easiest way to do this?
I have Membership, Profile and Role providers setup for my .NET MVC website. I would like to say: this Role has access to that Page. How do I 'inject' this code to the RoleProvider? Or do I have to override it somehow? Any leads?(Roles are stored in the default ASP.NET SqlRoleProvider, Pages are stored in a seperate SQL database).
I need to check if an authenticated user is authorized to access a directory. I have done this before with a base class library method, I just cannot remember what class it's part of or what it's name was. I think the method was a static method and the class may have had the word Utility in it's name, but I just can't remember or find it on the net. BUT I KNOW I HAVE USED IT! The method definition was something like:
Is it possible to validate a user's Username + Password without logging them in? I understand a usual login block will look like this:
[code]....
With the Membership.ValidateUser() call setting the cookie for the response.
However, there are some additional checks I'd like to perform after the password is confirmed. (Pulling out an expiry date for that user, for example).
Is there a way to do it without just calling FormsAuthentication.SignOut(); after invalidating the page?
I have a web page with paypal. In the page user add items to list then buy it. when user add item to list i block that item in stock until user buy or delete that item.Now my problem is when user add item in the list and then close the broswer from IE close button , the item get blocked. I want to rollback the added items when user close the browser from IE button.
I have an MVC app that uses [Authorize] to protect the private bits. When I select the SignOut() URL it signs me out but if I hit the back button on my browser the it goes to the secure page and even lets me use the form. The action takes place and then it shows that I'm signed out. The problem is that it performs the secured action (inserting a row into my database). Then I can use the back button again and do it all over. If I use the back button after logging out and hit the browser refresh it does show I'm logged out and refuses me access to the secure page. Am I missing something important? It seems like it could be a really big security issue.
public ActionResult LogOff(string ReturnUrl) { FormsAuth.SignOut(); if (!String.IsNullOrEmpty(ReturnUrl)) { return Redirect(ReturnUrl); } else { return RedirectToAction("Index", "Page"); } }
I created timecard for a website and I would like to automatically clock out the user everytime when user logout or close the website. Is there a control for that? And if yes, where do i have to put he code at?? I think it should be in the code behind of master page... and on the Page_Load function
How can I determine where a user came from when they land on my webpage.Did they come from a google link?Did they user a favorites link?Did they type in the url?