Re: How to set/get cookies?

Johan Brichau <[email protected]>
Newsgroups gmane.comp.lang.smalltalk.squeak.seaside
Message-ID <[email protected]>
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 <[email protected]> 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
> [email protected]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

_______________________________________________
seaside mailing list
[email protected]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.