Try leaving the domain as null (eg. new WOCookie("POOL",
session.poolName, "/", null, expires, true) ) and see what domain
gets set for the cookie. I do this on my development machine and the
cookie gets the domain of 'localhost.local'. I'm then able to retrieve
it fine.
Cheers,
Jake
On 07/01/2008, at 9:49 AM, Jeff Schmitz wrote:
Hello,
I'm trying to retrieve a previously set cookie from my browser
with the following code on my developement machine. I do see the
cookie my browser when I do Show Cookies. I'm launching my app from
WOLIPS (i.e. it uses the randomly generated port number instead of
80), but I never see the cookies. Does using the different ports
mess the cookie processing up in the browser? I'm setting and
trying to read the cookie on the same run, so the port isn't
changing between when the cookie is set and when I try to access
it. Note also that I'm just using the hardcoded IP address of my
development machine for the domain, should this be ok?
More details - Here's the code I'm using (inside my DirectAction
class) to just try and retrieve and print the cookie data. The
Form parameters come over fine, but I never see the cookies:
public WOActionResults loginAction() {
// Using formValues()
WOActionResults returnPage;
NSDictionary formVals = this.request().formValues();
System.out.println("login Hyperlink values: " + formVals);
System.out.println("login cookie values: "
+ this.request().cookieValues().toString());
}
I've tried setting the cookie various ways (shown below), and they
all seem to work as I can show the cookie in my browser, although
they end up with different domains (192.168.15.106, vs .
192.168.15.106) and paths depending on the method used to set the
cookie:
public void appendToResponse(WOResponse response, WOContext
context) {
// set cookies to remember details
System.out.println("In append to Response pool login: " +
session.poolName);
if (savePoolInfo) {
NSTimestamp expires = new NSTimestamp()
.timestampByAddingGregorianUnits(1, 0, 0, 0, 0, 0);
WOCookie poolCookie = new WOCookie("POOL",
session.poolName, "/", "192.168.15.106", expires, true);
// WOCookie poolCookie = new WOCookie("POOL",
session.poolName);
// poolCookie.setExpires(expires);
// set timeOuts
response.addCookie(poolCookie);
}
super.appendToResponse(response, context);
}
Any ideas?
Thanks,
Jeff
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/jmacmullin%40mac.com
This email sent to [EMAIL PROTECTED]
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com
This email sent to [EMAIL PROTECTED]