• 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: Handling Session timeout with ajax
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Handling Session timeout with ajax


  • Subject: Re: Handling Session timeout with ajax
  • From: Paul Hoadley <email@hidden>
  • Date: Thu, 29 Jan 2009 10:22:02 +1030

On 29/01/2009, at 4:08 AM, Chuck Hill wrote:

Score WebObjects: 1, Chuck: 0

Score Paul: 0, because...

The defect is mine.  The correct code is:

if (AjaxUtils.isAjaxRequest(aContext.request())) {
	// Create redirect to return to break out of Ajax
	AjaxUtils.redirectTo(errorPage);
	WOResponse redirect = errorPage.context().response();

// Generate the error page so that it gets into the page cache, don't do this earlier!
errorPage.generateResponse();
return redirect;
}


Or

if (AjaxUtils.isAjaxRequest(aContext.request())) {
	// Create redirect to return to break out of Ajax
	AjaxUtils.redirectTo(errorPage);
	WOResponse redirect = errorPage.context().response();

	// Force errorPage into the page cache, don't do this earlier!
	aContext.session().savePage(errorPage);
	return redirect;
}

Both of these still produce the same result for me: a redirect to something like AM.woa/wo/4.0, which it presumably can't find and so returns Main. I've got logging in Session.terminate(), and it's not being called.


Using the second variant, if I log the sessionID at the call to session().savePage(), it's different from the sessionID for the Main component that eventually gets displayed. So there's no session termination, but a new session is being created. I don't know whether this is expected, or part of the problem.


-- Paul.

w  http://logicsquad.net/
h  http://paul.hoadley.name/


_______________________________________________ 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
  • Follow-Ups:
    • Re: Handling Session timeout with ajax
      • From: Chuck Hill <email@hidden>
References: 
 >Handling Session timeout with ajax (From: Amedeo Mantica <email@hidden>)
 >Re: Handling Session timeout with ajax (From: Chuck Hill <email@hidden>)
 >Re: Handling Session timeout with ajax (From: Paul Hoadley <email@hidden>)
 >Re: Handling Session timeout with ajax (From: Chuck Hill <email@hidden>)
 >Re: Handling Session timeout with ajax (From: Paul Hoadley <email@hidden>)
 >Re: Handling Session timeout with ajax (From: Chuck Hill <email@hidden>)
 >Re: Handling Session timeout with ajax (From: Paul Hoadley <email@hidden>)
 >Re: Handling Session timeout with ajax (From: Chuck Hill <email@hidden>)
 >Re: Handling Session timeout with ajax (From: Paul Hoadley <email@hidden>)
 >Re: Handling Session timeout with ajax (From: Chuck Hill <email@hidden>)
 >Re: Handling Session timeout with ajax (From: Paul Hoadley <email@hidden>)
 >Re: Handling Session timeout with ajax (From: Chuck Hill <email@hidden>)
 >Re: Handling Session timeout with ajax (From: Paul Hoadley <email@hidden>)
 >Re: Handling Session timeout with ajax (From: Chuck Hill <email@hidden>)
 >Re: Handling Session timeout with ajax (From: Paul Hoadley <email@hidden>)
 >Re: Handling Session timeout with ajax (From: Chuck Hill <email@hidden>)
 >Re: Handling Session timeout with ajax (From: Chuck Hill <email@hidden>)

  • Prev by Date: Re: multiple stacks exception from ERXPrototypes
  • Next by Date: Re: Handling Session timeout with ajax
  • Previous by thread: Re: Handling Session timeout with ajax
  • Next by thread: Re: Handling Session timeout with ajax
  • Index(es):
    • Date
    • Thread