Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Best practice for Protocol switching and loss of HttpSession  RSS feed

 
russell stoneyroyd
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a problem which is quite common that adding items to a shopping cart is done over http. However when entering credit card form etc this is done over https. The results from this are posted to a struts action which gets a handle on the HttpSession object which is empty as the protocol has changed to https. What is the best way to implement protocol switching and session handling. I seem to find lots of solutions but they seem a little hacky. I'm sure many people have seen this issue before. But not sure what the best solution for this is.
Thanks
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Most real world sites store their carts in something more persistent than a JSP session; like a database, tracked with a cookie.

Doing so, allows your users to shop, close their browser, come back another day and shop some more before checking out.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!