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

  • SEARCH
  • Home
  • 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 7765211
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T15:06:47+00:00 2026-06-01T15:06:47+00:00

My question is similar to this one , but I can simplify it some.

  • 0

My question is similar to this one, but I can simplify it some. Basically I want to authenticate users through the remember me cookie, but I want everything on the server side to be completely stateless, i.e. never create a HttpSession. I have the following setup:

<security:http use-expressions="true" create-session="stateless" >
    <security:intercept-url pattern="/index.jsp" access="hasRole('ROLE_ANONYMOUS')" />
    <security:intercept-url pattern="/**" access="hasRole('ROLE_TEST')" />
    <security:form-login login-page="/index.jsp" default-target-url="/home" always-use-default-target="true" authentication-failure-url="/index.jsp?login_error=1" />
    <security:logout logout-success-url="/index.jsp"/>
    <security:remember-me key="MY_KEY" />
</security:http>

<security:authentication-manager>
    <security:authentication-provider>
        <security:user-service>
            <security:user name="testUser" password="testPassword" authorities="ROLE_TEST" />
        </security:user-service>
    </security:authentication-provider>
</security:authentication-manager>

I authenticate just fine with the username and password above and see the remember me cookie in my browser. That part of it is working great. However, I’m finding it is creating a session during this process. I thought the create-session="stateless" was supposed to prevent this. Am I missing something here?

  • 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-01T15:06:48+00:00Added an answer on June 1, 2026 at 3:06 pm

    After working with this more, I found out that it wasn’t Spring Security that was creating the session. The index.jsp was creating a new session every time I hit it. I simply added <%@ page session="false"> to the top of index.jsp, and now there are no sessions being created.

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

Sidebar

Related Questions

My question is similar to this one but I'm having some problems with the
My question is similar to this one but none of the answers solve my
My question is similar to this one , but I would like to replicate
My question popped up a very similar question, this one . But the accepted
I have asked a similar question to this one already but I think it
I saw this similar question here but can't figure out how to use Contains
This question is pretty much similar to this one , but for SQL Server
I already asked a similar question but this one is a bit different/specific: I'm
I asked a pretty similar question a few days ago, but this one is
I know there is another question that exists similar to this one but I

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.