Chris,
The code below is from org.apache.jetspeed.modules.actions.JLoginUser.java
Cookie userName = new
Cookie("username",data.getUser().getUserName());
Cookie loginCookie = new
Cookie("logincookie",loginCookieValue);
userName.setMaxAge(maxage);
userName.setComment(comment);
userName.setDomain(domain);
userName.setPath(path);
loginCookie.setMaxAge(maxage);
loginCookie.setComment(comment);
loginCookie.setDomain(domain);
loginCookie.setPath(path);
data.getResponse().addCookie(userName);
data.getResponse().addCookie(loginCookie);
It is worth noting that actions, like JLoginUser, are called before any
portlets content is generated. Their may be an issure around when the
HTTP header is sent to the browser relative to when the portlet's
getContent() is called.
Hope this helps.
Paul Spencer
Chris Widhelm wrote:
>I tried that. 8) Still did not work.
>
>It seems that Fulcrum is some how intercepting the response at some point
>and ignoring the cookies that I am setting.
>
>Are you using the CookieParser to set the cookies? Or are you setting them
>directly on the response?
>
>Thanks,
>
>Chris
>
>
>
>>-----Original Message-----
>>From: Mark Orciuch [SMTP:[EMAIL PROTECTED]]
>>Sent: Friday, August 02, 2002 1:08 PM
>>To: Jetspeed Users List
>>Subject: RE: Setting cookies
>>
>>I was having similar problem. I'm assuming that you use localhost to test.
>>I
>>was told that there's a glitch with cookies when you use short host name
>>such as localhost. Recommendation was to add an entry in your hosts file
>>(if
>>your're using Windows) such as:
>>
>>127.0.0.1 inside.localhost.com
>>
>>and then reference Jetspeed as follows:
>>http://inside.localhost.com:8080/jetspeed. This doesn't make sense to me
>>but
>>it works. Hope this helps.
>>
>>Best regards,
>>
>>Mark C. Orciuch
>>Next Generation Solutions, Ltd.
>>e-Mail: [EMAIL PROTECTED]
>>web: http://www.ngsltd.com
>>
>>
>>-----Original Message-----
>>From: Chris Widhelm [mailto:[EMAIL PROTECTED]]
>>Sent: Friday, August 02, 2002 8:33 AM
>>To: Jetspeed-User (E-mail)
>>Subject: Setting cookies
>>
>>
>>I am having problems setting cookies in a portlet that I have created. The
>>portlet extends AbstractPortlet. I have tried a number of different ways.
>>
>> runData.getCookies().set( "name", "value", 1500 );
>>
>> or
>>
>> runData.getCookies().add( "name", "value" );
>>
>> or
>>
>> HttpResponse response = runData.getResponse();
>> Cookie cookie = new Cookie( "name", "value" );
>> cookie.setMaxAge( 1500 );
>> response.addCookie( cookie );
>>
>>None of these techniques seem to work. Does anyone know how to set
>>cookies
>>within Jetspeed?
>>
>>Thanks,
>>
>>Chris
>>
>>--
>>To unsubscribe, e-mail:
>><mailto:[EMAIL PROTECTED]>
>>For additional commands, e-mail:
>><mailto:[EMAIL PROTECTED]>
>>
>>
>>--
>>To unsubscribe, e-mail:
>><mailto:[EMAIL PROTECTED]>
>>For additional commands, e-mail:
>><mailto:[EMAIL PROTECTED]>
>>
>>
>
>--
>To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>
>
>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>