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 protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com
This email sent to [email protected]