• 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: wosid != session().sessionID()
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: wosid != session().sessionID()


  • Subject: Re: wosid != session().sessionID()
  • From: "Ricardo J. Parada" <email@hidden>
  • Date: Tue, 28 Oct 2008 22:56:22 -0400


The weird thing is that my direct action class has this code:

public WOActionResults performActionNamed(String name) {


// Generate responses for active sessions.  If existingSession() returns null
// then there is no session ID (in a cookie or url) or the session has expired.


if (existingSession() == null) {
return null;
}
// The null pointer exception happens here because the code
// assumes that the session has some info (non-null) in it.

... code omitted here ... 

}

So if the original session expired this method should be returning null.  But it's not doing that.  Instead, execution falls through and is getting to the code that assumes that the session is the original session and it tries to get some object that was stored in the session and then message that.  But because a new session is created that object is null, and messaging it generates the null pointer exception.

Anyways, I can just add a null check but I'd like to understand why existingSession() is returning non-null which means there is an active (non-expired) session and yet when I call session() I get a different session object.

Or am I missunderstanding existingSession() here?




On Oct 28, 2008, at 8:43 PM, Chuck Hill wrote:


On Oct 28, 2008, at 5:37 PM, Ricardo J. Parada wrote:


I have a direct action that sometimes it gets a null pointer exception because some of the information previously stored in the session is no longer there and my code assumes it is there.  Anyways, digging a little bit more I found out that the reason is doesn't find the information stored in the session is because the session() method is not returning the original session corresponding to the wosid in the URL.  I made my direct action log the wosid from the URL and session().sessionID() and they are different:

wosid = iLdoMvh8zYtFsNsph9lltg
session().sessionID() = Hh5Qoar5sRzlXzwDnvBh0w

Anyways, does any body have any advise as to why this is happening?  If the original session expired, would then session() return a new session?


Yes.

Chuck

--
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

  • Follow-Ups:
    • Re: wosid != session().sessionID()
      • From: "Ricardo J. Parada" <email@hidden>
References: 
 >wosid != session().sessionID() (From: "Ricardo J. Parada" <email@hidden>)
 >Re: wosid != session().sessionID() (From: Chuck Hill <email@hidden>)

  • Prev by Date: Re: Object Store Coordinator and User Info – Is this Dangerous?
  • Next by Date: Re: WebService and HTTPS
  • Previous by thread: Re: wosid != session().sessionID()
  • Next by thread: Re: wosid != session().sessionID()
  • Index(es):
    • Date
    • Thread