ok, seems I have a handle on this issue now. I was testing the code using Safari 1.25 (Browser) on OS X 10.3.3. By default, the browser is set to accept cookies 'only from sites you navigate to'!. Changing this setting to accept cookies 'always' solved the problem. Correct me if I am wrong here, but isn't a session variable created on the server??? Why are the browsers coolie settings affecting this???
Peter
On 14 Apr 2004, at 22:36, beyaNet Consultancy wrote:
Hi,
How do I determine, in XSP:LOGIC, whether a session object has already been created? Basically I am trying to persist an object, in this case an Order object, in a session:
//1.Determine if an order has been created
Order newOrder = (Order)session.getAttribute("ORDER");
if (newOrder == null){
newOrder = new Order();
}
//2.check that stock exists
Stock newStk = InsertOrder.checkStock("d1e22501fbd4255600fbd42559d30001");
//3.Add stock item
newOrder.addProduct(newStk,32);
//4.Update Session object
session.setAttribute("ORDER", newOrder);
The problem is that the if statement is not working, and as a result a new Order object is being created on each pass of the page. What am I doing wrong?
Peter