aspose file tools
The moose likes Servlets and the fly likes Best practice for Protocol switching and loss of HttpSession Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Servlets
Reply Bookmark "Best practice for Protocol switching and loss of HttpSession" Watch "Best practice for Protocol switching and loss of HttpSession" New topic
Author

Best practice for Protocol switching and loss of HttpSession

russell stoneyroyd
Greenhorn

Joined: Sep 12, 2006
Posts: 9
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

Joined: Dec 11, 2004
Posts: 13410

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.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Best practice for Protocol switching and loss of HttpSession
 
Similar Threads
Session Tracking
Login/https over spring - REST ?
Http and Https
setsecure method in cookies
session for HTTP AND HTTPS