Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: Superfluous Session Creation
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Superfluous Session Creation



Hi Joe,

Welcome to the list!


On Jan 28, 2009, at 8:58 AM, Joe Kramer wrote:

Hello everyone,

I am fairly new to the WebObjects world, so I was hoping to get some help. I am running into a problem with extra sessions getting created from a directAction . The part I don't understand is that a session already exists somewhere, but context().hasSession is false and existingSession() is null. I have the following logging statement:

logger.info(Application.application().activeSessionsCount() + " " + context().hasSession() + " " + existingSession());

This produces "1 false null" the first time the directAction is called. Each subsequent call to the directAction adds another session, while the other two values remain false and null. I know that the new session is created when pageWithName is called from the directAction, but I don't know why the session is being created and why I can't access it after it is created. Thanks in advance for any help.

WebObjects can know about the session from two places: the URL or a cookie. Where are you storing your session ID? If you using the default of storing them in the URL and are hitting a direct action URL like


http://www.domain.com/cgi-bin/WebOjbects/MyApp.woa/wa/myDirectAction

then you are going to get a new session each time as there is no session ID in that URL. See the WOSession documentation for how to move the session ID into a cookie.

Chuck



Regards,

Joe Kramer

P.S. I am using Eclipse 3.4 and WebObjects 5.4.


--
Chuck Hill             Senior Consultant / VP Development

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: 
 >Superfluous Session Creation (From: Joe Kramer <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.