Win a copy of 97 Things Every Java Programmer Should Know this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

shopping cart data lost after login

 
Ranch Hand
Posts: 229
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I am using spring mvc 3/4+, with spring security.

Before login, I added some data to the shoppign cart (with session annotated), and then login.
After login, shopping cart becomes enpty.
I think session id is changed, so data in cart is all gone.

With spring security, is there any way I can copy all data from shopping cart to new session before refresh ssession by spring security ?


Here is security-config.xml:

 
sam White
Ranch Hand
Posts: 229
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I 'd like to further explain the issue:
Before login, user added items to the shopping cart.
When user checkout, user decided to login first, but after login, all purchased items in the shopping cart is gone.

Here is my shoppingCartServiceIimpl java class:



This data lost may be caused by spring security changed the session .

Now, is there any way I can keep/find the session obj before user login, and copy the shopping cart data to the new session after user login?

Thank you for your help again
Sam
 
Just let me do the talking. Ahem ... so ... you see ... we have this tiny ad...
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic