• 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
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

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
 
no wonder he is so sad, he hasn't seen this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!