Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Java Object Serialisation V/S Cookies  RSS feed

 
Kedar Patwardhan
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Forum,

Actually I am working in J2EE on Struts Framework.I am working on an application related to Online Shopping wherein Users Log In, select the Items they want to buy and finally make the payment through various modes.

If the payment is made through Credit Card then we have various payment gateways through which payment is made and within few seconds an Acknowledgement is received from the payment gateway on our Server.

Now when the payment-ack comes from the gateway we fetch the data from the Session instance and put all the details (User Details + Purchase Details) in to our Database.

But the problem is happening is that many a times, when the ack comes from the payment gateway till that time the session expires and we fail to fetch the details.

So now we are planning to make that further operation as session independent. So now I want to ask that amongst JAVA OBJECT SERIALISATION and COOKIE MANAGEMENT which approach would be better?

Which approach would be better with minimum complexity?

Thank You in advance.

Regards,
Kedar
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 37180
515
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't think I'm understanding the problem properly. The user has a valid session when submitting the credit card request. A few seconds later, the session is no longer valid when the ack comes back. This implies that the session timeout is only a few seconds. Which seems impossible as it took longer to shop in the first place. Can you clarify which step I am missing?

This is important, because the best places to store this data are in the session or in the database in a temp table for pending orders. (Stores that remember your shopping cart contents between sessions use this later approach.) A cookie doesn't work because the user can tamper with it. And where would you store the serialized object?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!