Well, I was pretty much using the default code in the plugin text:
In the page, I have an if statement, based upon if there is a segment_2. If there is one, then I go through, grab the appropriate blog and want to set the cookie with:
{exp🍪store name="mycoach" value="x” seconds=“3600"}
if there is no segment_2, then I want to use the cookie to get something out of the db using a query. So I pull the cookie using:
{exp🍪retrieve name="mycoach"}
I have tried a few different things to get the data out, but when that didn’t work, I went to the browser and went looking for the cookie at the time I set it. The cookie does not show up. If I create some php code in the page, then the cookie gets set. So I am thinking maybe it’s a problem with the plugin not working right. But there’s not a lot to the plugin, or the underlying php code. I am hoping that maybe there is a simple setting somewhere or a step I missed.
Thanks!
There is no COOKIE specific retrieval function but the Input class should be able to retrieve a cookie like this:
$IN->GBL('cookie_name', 'COOKIE');
Cookies are notably domain specific though. A browser won’t give up one domain’s cookie to a page on another domain. You aren’t trying to do that are you?
Jamie
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.