This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes Servlets and the fly likes cookies and shoping baskets Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "cookies and shoping baskets" Watch "cookies and shoping baskets" New topic
Author

cookies and shoping baskets

Wendy Gibbons
Bartender

Joined: Oct 21, 2008
Posts: 1107

Ok i am rather a web site newbie, and looking for design patterns really

how do you write a shopping basket if cookies are turned off?

i could use url rewritting (the name from head first) but i was using cookies to get around session timeout.
Devaka Cooray
ExamLab Creator
Sheriff

Joined: Jul 29, 2008
Posts: 3709
    
  89

Wendy Gibbons wrote:i could use url rewritting (the name from head first) but i was using cookies to get around session timeout.

Session timeout depends on the HttpSession object. Even if URL rewriting is used, the HttpSession object remains accessible as the same way as how you use it when cookies are used.

Devaka


Author of ExamLab ExamLab - a free SCJP / OCPJP exam simulator
What would SCJP exam questions look like? -- Home -- Twitter -- How to Ask a Question
Michael Angstadt
Ranch Hand

Joined: Jun 17, 2009
Posts: 276

You could configure the session to never timeout by setting the session-timeout to -1. Then, store the shopping cart info as session attributes.


SCJP 6 || SCWCD 5
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: cookies and shoping baskets
 
It's not a secret anymore!