You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by sub <b4...@nwldx.com> on 2012/10/25 16:24:58 UTC

Re: t5: clear cookie when browser closes

I also have the problem to set a so called "session cookie" with tapestry.

org.apache.tapestry5.services.Cookies Interface is missing (among others)
this method:

public void writeCookieValue(String name, String value, String path, int
maxAge)

So if you want to write a Cookie with a custom path and also a custom maxAge
you can't. The workaround that I used so far is 

public void writeCookieValue(String name, String value, String path)

and set the maxAge global via AppModule:

configuration.add(SymbolConstants.COOKIE_MAX_AGE, "7200000");


But now I want to switch from the persistent cookie to a session cookie, so
I changed the line to:
configuration.add(SymbolConstants.COOKIE_MAX_AGE, "-1");

which results in this exception:

Exception constructing service 'Cookies': Coercion of -1 to type
org.apache.tapestry5.ioc.util.TimeInterval (via String -->
org.apache.tapestry5.ioc.util.TimeInterval) failed: Unexpected string '-'
(in time interval '-1').

What other options do I have?

Thx
Tim






--
View this message in context: http://tapestry.1045711.n5.nabble.com/t5-clear-cookie-when-browser-closes-tp3380592p5717232.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: t5: clear cookie when browser closes

Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Fri, 26 Oct 2012 11:22:06 -0200, sub <b4...@nwldx.com> wrote:

> Thiago,

Hi!

> there already is a ticket:
> https://issues.apache.org/jira/browse/TAP5-1394
> I voted for it.

Ah, OK, I overlooked that. Thanks!

-- 
Thiago H. de Paula Figueiredo

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: t5: clear cookie when browser closes

Posted by sub <b4...@nwldx.com>.
Thiago,

there already is a ticket:
https://issues.apache.org/jira/browse/TAP5-1394

I voted for it.





--
View this message in context: http://tapestry.1045711.n5.nabble.com/t5-clear-cookie-when-browser-closes-tp3380592p5717292.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: t5: clear cookie when browser closes

Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Fri, 26 Oct 2012 06:30:05 -0200, sub <b4...@nwldx.com> wrote:

> Well I ended up injecting the HttpServletResponse and use
> HttpServletResponse.addCookie directly. I really would liked to use the
> methods provided by Tapestry to keep the code clean of any workarounds,  
> but I don't think this is possible for this issue.

Could you please file a JIRA asking for this missing method?

-- 
Thiago H. de Paula Figueiredo

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: t5: clear cookie when browser closes

Posted by sub <b4...@nwldx.com>.
Well I ended up injecting the HttpServletResponse and use
HttpServletResponse.addCookie directly. I really would liked to use the
methods provided by Tapestry to keep the code clean of any workarounds, but
I don't think this is possible for this issue.

Thanks,
Tim



--
View this message in context: http://tapestry.1045711.n5.nabble.com/t5-clear-cookie-when-browser-closes-tp3380592p5717271.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org