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?