Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8529069
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T08:56:45+00:00 2026-06-11T08:56:45+00:00

How I get remember me value when login failed and reopen the login page?

  • 0

How I get remember me value when login failed and reopen the login page?
Can i get the value of _spring_security_remember_me on controller?

I just need to keep the value of the checkbox when login error occurs!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T08:56:47+00:00Added an answer on June 11, 2026 at 8:56 am

    You can try the following solution:
    1. insert custom filter into spring security filter chain
    2. inside this filter obtain http session and store there the value of request parameter

    As we change the login form (adding another parameter) we need to customize spring representation of login form and spring login processing filter.
    Here is the configuration:

    <authentication-manager alias="authenticationManager"/>
    
    <beans:bean id="myFilter" class="test.MyAuthenticationProcessingFilter">
        <custom-filter position="AUTHENTICATION_PROCESSING_FILTER" />
        <beans:property name="defaultTargetUrl" value="/initialize.action"/>
        <beans:property name="authenticationFailureUrl" value="/login_failed.action"/>
        <beans:property name="authenticationManager" ref="authenticationManager"/>
        <beans:property name="alwaysUseDefaultTargetUrl" value="true"/>
        <beans:property name="filterProcessesUrl" value="/perform_login"/>
    </beans:bean>
    
    <beans:bean id="entryPoint" class="org.springframework.security.ui.webapp.AuthenticationProcessingFilterEntryPoint">
        <beans:property name="loginFormUrl" value="/login.action"/>
    </beans:bean>
    

    MyAuthenticationProcessingFilter extends spring’s org.springframework.security.ui.webapp.AuthenticationProcessingFilter, wraps attemptAuthentication method obtaining request parameter and storing it inside http session. This class is written just to show the idea, for better practice browse AuthenticationProcessingFilter code for username and password parameters.

    public class MyAuthenticationProcessingFilter extends AuthenticationProcessingFilter {

    @Override
    public Authentication attemptAuthentication(HttpServletRequest request)
            throws AuthenticationException {
        String param = request.getParameter("_spring_security_remember_me");
    
        HttpSession session = request.getSession();
        if (session != null || getAllowSessionCreation()) {
            session.setAttribute("_spring_security_remember_me", param);
        }
    
        return super.attemptAuthentication(request);
    }
    
    }
    

    You may notice that “myFilter” and “entryPoint” beans together define parameters that are otherwise defined by element inside . You use when you want the default behavior. But in our case we use custom beans, so you should remove element completely.
    Now we need to tell use our beans. “myFilter” bean is passed to spring chain by using element inside bean definition:

    <beans:bean id="myFilter" class="test.MyAuthenticationProcessingFilter">
        <custom-filter position="AUTHENTICATION_PROCESSING_FILTER" />
        ...
    </beans:bean>
    

    “entryPoint” is passed to using attribute:

    <http entry-point-ref="entryPoint">
        ...
        <!-- no form-login here -->
    </http>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I can't get my iPhone to remember my username and password for the login
I can't get 'remember' to work in org-mode of emacs. I'm on snow leopard.
I remember seen some code xaml where can get the first element (like an
I've seen somewhere but can not remember. How to get a SQL string from
I have a view with filters, with remember last option. I need to get
I had login Page and it worked well but remember me check box didn't
I have some kind of controller: @Controller public class DefaultController { @RequestMapping(value=/index.html, method=RequestMethod.GET) public
How can I get values from config.yml or security.yml in the controller in Symfony2?
I can get the value of the guifont configuration value by typing: :set guifont?
I'm trying to get the rememberMe() function to remember users and retain sessions for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.