[Seaside] How to set/get cookies?
Johan Brichau
johan at inceptive.be
Thu May 3 15:38:53 UTC 2018
Hi Tim,
Getting cookies, by accessing the WARequest instance from within your callback/rendering code:
self requestContext request cookieAt: ‘myCookie'
Setting cookies, by accessing the WAResponse instance from within your rendering code:
self requestContext response addCookie:
(self requestContext newCookie
path:’/myApp';
key: ‘myCookie';
value: ‘myCookie').
Hope this puts you on your way!
Cheers
Johan
> On 3 May 2018, at 12:28, Tim Mackinnon <tim at testit.works> wrote:
>
> Hi - I’m trying to get back into seaside, and I’m trying to understand how you get/set cookies? I can see WACookie and WARequest has a #cookieAt: method - but I’m missing the key piece about where in your application lifecycle you can access these things to store for example a user preference (without going full hog with a database).
>
> Tim
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
More information about the seaside
mailing list