• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Strange auto creation of session...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Strange auto creation of session...


  • Subject: Re: Strange auto creation of session...
  • From: Chuck Hill <email@hidden>
  • Date: Mon, 11 Sep 2006 09:38:40 -0700


On Sep 11, 2006, at 9:28 AM, Pyramide-Ingenierie Developer List wrote:

Hello,

Once upon a time, I had problems with my WebObjects applications that refuse to leave at sheduled time due to untrapped Exceptions in Direct Actions (our first use of Direct Actions)... Before finding that these untrapped Exceptions were the reason, we put many NSLog traces in our sessions creator and terminate methods...

Working once again on this apps, I noticed that each time I goes on two specific application web pages, a session is created that we do not even use: the first main session is still used, happily... These two pages only differ from the others in the way that they are the only ones to include "File Upload" dynamic element (one page has 1, the other has 5)... The WOForm have its encoding type correctly set in both components...

I do not know if it is a new behaviour or an old one: I am just upgrading to Xcode 2.4 and it is my first try in WebObjects 5.3 and my session traces are rather new... May be it has nothing to see with the "File Upload" dynamic elements ?

I checked to see if any "Direct Action" call was made from these pages: none !

Does someone noticed such behaviour ? Or does someone know what can lead to automatic session creation ? Or, even better, how can I avoid such behaviour ?


Hi Luc,

The problem is usually to be found in incorrect HTML or JavaScript. This results in the browser making another request of the app, a request that does not include a session so a new one is created.

There are two good ways to track this down. Using them both at the same time is usually the most effective approach.

1) Add this to your Session.java constructor:

NSLog.out.appendln(new RuntimeException("Session Created at:"));

This will provide a stack trace to where each new session was created.


2) Override dispatchRequest in Application to be something like this:

    public WOResponse dispatchRequest(WORequest request)
    {
            NSLog.debug.appendln("Dispatching URI " + request.uri());
            return super.dispatchRequest(request);
    }


This should allow you to see the URI that is creating the extra session. You will then need to trace this back to your HTML/JavaScript.


Chuck

--

Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems. http://www.global-village.net/products/practical_webobjects





_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Strange auto creation of session... (From: Pyramide-Ingenierie Developer List <email@hidden>)

  • Prev by Date: Strange auto creation of session...
  • Next by Date: Navigation Working Example?
  • Previous by thread: Strange auto creation of session...
  • Next by thread: Navigation Working Example?
  • Index(es):
    • Date
    • Thread