logout

ASP.Net MVC 5 w/identity 2.2.0 Log off not working

天涯浪子 提交于 2019-11-30 12:26:25
问题 I am using a the basic login on a test ASP.Net MVC 5 site (for an internet site). The login works fine but when I try to logout it doesn't happen. The logout link does call the following controller action: public ActionResult LogOff() { AuthenticationManager.SignOut(); return RedirectToAction("Index", "Home"); } But the user stays logged in. How do I ensure that the user actually gets logged out? 回答1: I had this problem before, change: AuthenticationManager.SignOut(); To:

rails devise, no route matches logout

旧巷老猫 提交于 2019-11-30 12:09:59
Though there're lots of similar questions, i've searched for it for hours but still can not fix it. Env rails 3.0.9 ruby 1.9.2 devise 1.4.2 I changed the default login url using: 5 resources :users 6 devise_for :users, :path => "", :path_names => { :sign_in => 'login', :sign_out => 'logout', :password => 'secret', :confirmation => 'verification', :unlock => 'unblock', :registration => 'register', :sign_up => 'cmon_let_me_in' } And the http://localhost:3000/login works fine for me But I include = link_to 'sign_out', destroy_user_session_path, :method => :delete in my application.haml, after i

Activity.finishAffinity() vs Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK

◇◆丶佛笑我妖孽 提交于 2019-11-30 10:55:23
In Android, if you want to clear your current Activity stack and launch a new Activity (for example, logging out of the app and launching a log in Activity ), there appears to be two approaches. Are there any advantages to one over the other if your target API level is above 16? 1) Finish Affinity Calling finishAffinity() from an Activity. Activity.finishAffinity 2) Intent Flags Intent intent = new Intent(this, LoginActivity.class); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK); startActivity(intent); finish(); The finishAffinity() approach is suitable for >=

Perform certain System Events, Mac OS X

不打扰是莪最后的温柔 提交于 2019-11-30 10:15:00
I would like to Shutdown Restart Logoff Sleep My system through an application I'm making, I can't seem to find any native Objective C way to do it and it's really tough. Can anyone guide me on the best way to do this: I have tried: NSString *scriptAction = @"restart"; // @"restart"/@"shut down"/@"sleep"/@"log out" NSString *scriptSource = [NSString stringWithFormat:@"tell application \"Finder\" to %@", scriptAction]; NSAppleScript *appleScript = [[[NSAppleScript alloc] initWithSource:scriptSource] autorelease]; NSDictionary *errDict = nil; if (![appleScript executeAndReturnError:&errDict]) {

Symfony2 FOSUserBundle – Validate against “user active” flag on login

筅森魡賤 提交于 2019-11-30 09:50:30
I have a flag on my users for 'active' and if set to zero or null, I will not allow login. I have tried a couple of approaches and come up short. If I do the logout route the flash message is not preserved, so the user sees nothing. I looked into adding a validation on the login form so that it would throw a normal form error if the flag was not set to true, but in that folder (vendor/Bundles/FOS/UserBundle/Form/Type) I find nothing for login form, only registration and such, so I wouldn't know where to put it or where to inherit from in order to override. I also tried as suggested here to

How to logout user in OWIN ASP.NET MVC5

99封情书 提交于 2019-11-30 08:57:08
I have got a standard AccountController class of ASP.NET MVC5 project. When I try to log out user I am facing an error coz HttpContext is null . (I mean here HttpContext .GetOwinContext().Authentication is null) So I cannot get how we can logout user when session ends... In global.asax I have got this protected void Session_Start(object sender, EventArgs e) { Session.Timeout = 3; } protected void Session_End(object sender, EventArgs e) { try { var accountController = new AccountController(); accountController.SignOut(); } catch (Exception) { } } AccountController public void SignOut() { //

How do you log out all logged in users in spring-security?

时光毁灭记忆、已成空白 提交于 2019-11-30 06:21:13
I want to be able to log out all logged in users programmatically. How do you force logout all users on some event? First define HttpSessionEventPublisher in web.xml <listener> <listener-class>org.springframework.security.web.session.HttpSessionEventPublisher</listener-class> </listener> Then define <session-management> in your spring security.xml file. Now, use SessionRegistry in your controller method to invalidate all sessions. Below code retrieves all active sessions. List<SessionInformation> activeSessions = new ArrayList<SessionInformation>(); for (Object principal : sessionRegistry

Return to initial view controller when user logs out

折月煮酒 提交于 2019-11-30 05:09:07
I'm working on an app which uses Facebook integration, and the log in system works fine now. However, I can't seem to return to my initial view controller when the user clicks log out . Here's an overview of my storyboard : I would like to return to the start when the user clicks the blue button (on the top). What would I do to achieve that? As you can see I have multiple Navigation Controllers , and I only use Push-segues to get there. However, I do use the SWRevealViewController , which you can see in the middle. I've tried [self.navigationController popToRootViewControllerAnimated:YES];

Get Log off event from system

狂风中的少年 提交于 2019-11-30 04:43:35
问题 I am doing an application which is used to clear the Temp files, history etc, when the user log off. So how can I know if the system is going to logoff (in C#)? 回答1: There is a property in Environment class that tells about if shutdown process has started: Environment.HasShutDownStarted But after some googling I found out that this may be of help to you: using Microsoft.Win32; //during init of your application bind to this event SystemEvents.SessionEnding += new SessionEndingEventHandler

How to logout when using .htaccess (and .htpasswd) authentication? [duplicate]

前提是你 提交于 2019-11-30 04:31:02
Possible Duplicate: HTTP authentication logout via PHP Hi I have a some functionality on my website protected using .htaccess and .htpasswd . When users attempt to access this, they get prompt to enter details. They enter their details and get in and can see stuff etc. All works fine. My question is how do I create a logout functionality for this type of authentication. I know that they can close the browser window to "Logout". But this is not ideal. What would you suggest to me? Thanks. Ludwig Weinzierl Browsers usually don't support this, see How do I log out? Since browsers first started