You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Dustin Frazier <ta...@frayzhe.net> on 2005/08/18 00:31:21 UTC
cookie expiration workaround
I understand that the current CookieSource service doesn't yet allow you to set the
expiration for a cookie you create. Unfortunately, in Firefox this means that cookies are
only valid for the current session (it seems to defaults to session scope if no expiration
is given).
So, I'd like to access the raw Cookie class from javax.servlet and create/write the cookie
myself until the issue with CookieSource is fixed. Question: what's the correct Tap4 way
of accessing the HttpServletResponse during render and in my listener? I tried going
through getRequestCycle().getRequestContext().getResponse(), but it looks like
getRequestContext() on IRequestCycle is deprecated. Frustratingly, the deprecation
comment in the source doesn't say anything about the right way to access this in Tap4.
Any help would be much appreciated!
Dustin
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
RE: cookie expiration workaround
Posted by Patrick Casey <pa...@adelphia.net>.
Ack, sorry Dustin, didn't realize you were running into deprication
issues with Tap 4; thought this was a Tap 3 question.
--- Pat
> -----Original Message-----
> From: Patrick Casey [mailto:patcasey@adelphia.net]
> Sent: Wednesday, August 17, 2005 3:35 PM
> To: 'Tapestry users'
> Subject: RE: cookie expiration workaround
>
>
> How about you just hit the cookie API manually?
>
> RequestContext cx = cycle.getRequestContext();
> Cookie cookie = new Cookie(LOGIN_COOKIE, fUserName);
> cookie.setMaxAge(604800);
> cx.addCookie(cookie);
>
> --- Pat
>
> > -----Original Message-----
> > From: news [mailto:news@sea.gmane.org] On Behalf Of Dustin Frazier
> > Sent: Wednesday, August 17, 2005 3:31 PM
> > To: tapestry-user@jakarta.apache.org
> > Subject: cookie expiration workaround
> >
> > I understand that the current CookieSource service doesn't yet allow you
> > to set the
> > expiration for a cookie you create. Unfortunately, in Firefox this
> means
> > that cookies are
> > only valid for the current session (it seems to defaults to session
> scope
> > if no expiration
> > is given).
> >
> > So, I'd like to access the raw Cookie class from javax.servlet and
> > create/write the cookie
> > myself until the issue with CookieSource is fixed. Question: what's the
> > correct Tap4 way
> > of accessing the HttpServletResponse during render and in my listener?
> I
> > tried going
> > through getRequestCycle().getRequestContext().getResponse(), but it
> looks
> > like
> > getRequestContext() on IRequestCycle is deprecated. Frustratingly, the
> > deprecation
> > comment in the source doesn't say anything about the right way to access
> > this in Tap4.
> >
> > Any help would be much appreciated!
> >
> > Dustin
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
RE: cookie expiration workaround
Posted by Patrick Casey <pa...@adelphia.net>.
How about you just hit the cookie API manually?
RequestContext cx = cycle.getRequestContext();
Cookie cookie = new Cookie(LOGIN_COOKIE, fUserName);
cookie.setMaxAge(604800);
cx.addCookie(cookie);
--- Pat
> -----Original Message-----
> From: news [mailto:news@sea.gmane.org] On Behalf Of Dustin Frazier
> Sent: Wednesday, August 17, 2005 3:31 PM
> To: tapestry-user@jakarta.apache.org
> Subject: cookie expiration workaround
>
> I understand that the current CookieSource service doesn't yet allow you
> to set the
> expiration for a cookie you create. Unfortunately, in Firefox this means
> that cookies are
> only valid for the current session (it seems to defaults to session scope
> if no expiration
> is given).
>
> So, I'd like to access the raw Cookie class from javax.servlet and
> create/write the cookie
> myself until the issue with CookieSource is fixed. Question: what's the
> correct Tap4 way
> of accessing the HttpServletResponse during render and in my listener? I
> tried going
> through getRequestCycle().getRequestContext().getResponse(), but it looks
> like
> getRequestContext() on IRequestCycle is deprecated. Frustratingly, the
> deprecation
> comment in the source doesn't say anything about the right way to access
> this in Tap4.
>
> Any help would be much appreciated!
>
> Dustin
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org