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 8502251
In Process

The Archive Base Latest Questions

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

My Spring Security XML is as following: <http use-expressions=true> <intercept-url pattern=/login access=isAnonymous() requires-channel=https/> <intercept-url

  • 0

My Spring Security XML is as following:

    <http use-expressions="true">
        <intercept-url pattern="/login" access="isAnonymous()" requires-channel="https"/>
        <intercept-url pattern="/login/" access="isAnonymous()" requires-channel="https" />
        <intercept-url pattern="/logout-success" access="isAnonymous()" />
        <intercept-url pattern="/logout-success/" access="isAnonymous()" />     
        <intercept-url pattern="/logout" access="isAuthenticated()" />

        <intercept-url pattern="/**" access="hasRole('ROLE_SUPER_ADMIN')" />
        <form-login login-page="/login/" default-target-url="/example/Login_execute"/>
        <logout logout-url="/logout" logout-success-url="/logout-success" />
        <remember-me services-ref="rememberMeServices"/>

        <port-mappings>
            <port-mapping http="8080" https="8443"/>
        </port-mappings>        
    </http>

...

    <beans:bean id="userDetailsService" class="com.myownpackage.UserAccountServiceImpl"/>

    <beans:bean id="rememberMeServices" class="org.springframework.security.web.authentication.rememberme.PersistentTokenBasedRememberMeServices">
        <beans:property name="userDetailsService" ref="userDetailsService" />
        <beans:property name="tokenRepository" ref="persistentTokenRepository" />
        <beans:property name="key" value="myownkey" />
    </beans:bean>

<beans:bean id="persistentTokenRepository" class="com.myownpackage.PersistentTokenRepositoryImpl" />  

Whenever I login and I tick the remember me, my program will save something to remember me database table (that’s correct).

If I close my browser, re-open the browser, and open a page which requires authentication, my program will execute processAutoLoginCookie at PersistentTokenBasedRememberMeServices and returning correct UserDetails (that’s also correct)

BUT, even so, I am still redirected to the login page.

By the way, the login page is customized, and what I do is just displaying JSP file with a form for login.

Is there any step I missed when writing the spring security XML?

  • 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-11T01:25:58+00:00Added an answer on June 11, 2026 at 1:25 am

    Spring Security’s “Remember Me” uses a Cookie in the client side, which is your browser.

    From Spring’s DOCS:

    Remember-me or persistent-login authentication refers to web sites
    being able to remember the identity of a principal between sessions.
    This is typically accomplished by sending a cookie to the browser,
    with the cookie being detected during future sessions and causing
    automated login to take place. Spring Security provides the necessary
    hooks for these operations to take place, and has two concrete
    remember-me implementations. One uses hashing to preserve the security
    of cookie-based tokens and the other uses a database or other
    persistent storage mechanism to store the generated tokens.

    Spring’s idea is that you will be able to login automatically between different Sessions:

    Server’s Sessions, meaning when the Server “bounces” (goes down and then up), are handled, for example, by Persistency.

    Clients’ Session are handled by the browser (Cookies). The browser uses a Cookie that Spring sends, the Server verifies this Cookie and lets the user login automatically , without the need to enter credentials again.

    Check the Cookies within your browser.

    HTH.

    Ohad.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using Spring Security 3 and my ApplicationContext-Security.xml specifies <form-login login-page=/genesis default-target-url=/diagnostics/start-diagnostics authentication-failure-url=/genesis?authfailed=true authentication-success-handler-ref=customTargetUrlResolver/>
When trying to autowire JdbcUserDetailsManager from Spring Security, I use following statement in appcontext.xml
I have a web application that uses spring security. It uses <intercept-url ../> elements
I was able to get spring security everything to work with the following: <http
I was just reading an article that showed the following Spring Security XML configuration:
I am using spring basic authentication with the following settings in my security xml:
Sorry I'm rather new to Spring Security. I've got the following applicationContext.xml <?xml version=1.0
In our project we're mixing xml and annotations based spring mvc security configuration. We've
This is working: <?xml version=1.0 encoding=UTF-8?> <beans:beans xmlns=http://www.springframework.org/schema/security xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance xmlns:beans=http://www.springframework.org/schema/beans xmlns:context=http://www.springframework.org/schema/context xsi:schemaLocation=http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/context
I use Spring Security 3 and JSF2 Primefaces. Then, I create a index.xhtml 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.