• 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: Component action context().hasSession() returns false? [Was Re: context().hasSession() returns false... then true?]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Component action context().hasSession() returns false? [Was Re: context().hasSession() returns false... then true?]


  • Subject: Re: Component action context().hasSession() returns false? [Was Re: context().hasSession() returns false... then true?]
  • From: Lachlan Deck <email@hidden>
  • Date: Tue, 1 Jul 2008 13:45:00 +1000

On 01/07/2008, at 1:51 AM, Rams wrote:

On Jun 29, 2008, at 8:43 PM, Lachlan Deck wrote:

On 28/06/2008, at 1:20 AM, Rams wrote:

Hi everyone...

I should add, I am currently using component actions. I'm not defaulting to direct actions yet... so I'm under the impression that there should always be a session present.

Not always so. But you can force a session to be invoked by referencing session() in your component.

The only time session() is called in my Main WO or any of it's embedded components, is in the authenticated method.


public Boolean authenticated() {
return (context().hasSession() && session().valueForKey(User.ENTITY_NAME.toLowerCase()) != null);
}

You can also try context().sessionID() to see if it has one. You can also look at com.webobjects.jspservlet.WOServletContext which is relevant when running in servlet environments.


I think you'll find that context().hasSession() is not checking for the presence of a jspServlet sessionID. So you'll need to adjust your if statement to suit.

But since I'm logging session creation in the Session() constructor, I know one should already exists. context().hasSession() is returning false even though a session exists.

You can also look at WOApplication.restoreSessionWithID(sessionID, woContext);


with regards,
--

Lachlan Deck



_______________________________________________
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: 
 >context().hasSession() returns false... then true? (From: Rams <email@hidden>)
 >Re: context().hasSession() returns false... then true? (From: Don Lindsay <email@hidden>)
 >Re: context().hasSession() returns false... then true? (From: Rams <email@hidden>)
 >Component action context().hasSession() returns false? [Was Re: context().hasSession() returns false... then true?] (From: Rams <email@hidden>)
 >Re: Component action context().hasSession() returns false? [Was Re: context().hasSession() returns false... then true?] (From: Lachlan Deck <email@hidden>)
 >Re: Component action context().hasSession() returns false? [Was Re: context().hasSession() returns false... then true?] (From: Rams <email@hidden>)

  • Prev by Date: EOEditingContext in Application
  • Next by Date: Re: EOEditingContext in Application
  • Previous by thread: Re: Component action context().hasSession() returns false? [Was Re: context().hasSession() returns false... then true?]
  • Next by thread: Zombie instance conundrum.
  • Index(es):
    • Date
    • Thread