• 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: Session ID and REST calls
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Session ID and REST calls


  • Subject: Re: Session ID and REST calls
  • From: Ted Archibald <email@hidden>
  • Date: Fri, 06 Jul 2012 14:21:28 -0600

Is there a reason you are setting the path like that, instead of overriding domainForIDCookies()?

e.g. 

@Override

  public String domainForIDCookies() {

    return ERXApplication.isDevelopmentModeSafe() ? super.domainForIDCookies() : "/" + "AppName" ;

  }


On Fri, Jul 6, 2012 at 9:59 AM, Pascal Robert <email@hidden> wrote:
Tip: if you are using sessions for your REST calls, and you need to read that sesesion ID from your _javascript_ client application, be aware that the path in the cookie will be /cgi-bin/WebObjects/something.woa/..., so if you try to check if the cookie is available in your _javascript_ app, it won't work since the path of your JS app is probably not in /cgi-bin/WebObjects.

So don't forget to change the path of the cookie, with a call like this in your Session class:

    public void _appendCookieToResponse(WOResponse aResponse) {
      super._appendCookieToResponse(aResponse);
      if (storesIDsInCookies()) {
        for (WOCookie cookie: aResponse.cookies()) {
          if ("wosid".equals(cookie.name())) {
            cookie.setPath("/");
          }
        }
      }
    }
 _______________________________________________
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

 _______________________________________________
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: Session ID and REST calls
      • From: Pascal Robert <email@hidden>
References: 
 >Session ID and REST calls (From: Pascal Robert <email@hidden>)

  • Prev by Date: Session ID and REST calls
  • Next by Date: Re: Session ID and REST calls
  • Previous by thread: Session ID and REST calls
  • Next by thread: Re: Session ID and REST calls
  • Index(es):
    • Date
    • Thread