• 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
How to get a session in ERRest?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to get a session in ERRest?


  • Subject: How to get a session in ERRest?
  • From: Pascal Robert <email@hidden>
  • Date: Fri, 27 May 2011 11:28:25 -0400

How do I get a session in ERRest? I was thinking that touching the session() object would be enough to get a cookie with the session ID in it, like this:

  public WOActionResults loginAction() throws Throwable {
    try {
      String username = request().stringFormValueForKey("username");
      String password = request().stringFormValueForKey("password");
      Member member = Member.validateLogin(session().defaultEditingContext(), username, password);
      NSLog.out.appendln(session().sessionID());
      return response(member, ERXKeyFilter.filterWithNone());
    } catch (MemberException ex) {
      return errorResponse(ex, 401);
    }
  }

session().sessionID() does contains a session ID, but no session ID is sent in the response (I do have setStoresIDsInCookies(true) in Session). Now, if I redirect to another page (eg, pageWithName(Main.class) instead of response(member, ERXKeyFilter.filterWithNone()), I do get the cookie with the session ID.

 _______________________________________________
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

  • Prev by Date: Re: John Huss, are you teasing me?
  • Next by Date: Re: Avoiding expensive database roundtrips for enterprise objects
  • Previous by thread: Re: Deleting instance with REST & JavaMonitor
  • Next by thread: What is the attendee count like for WOWODC?
  • Index(es):
    • Date
    • Thread