We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

$this->EE->input->cookie(); not working?

Development and Programming

Graham Huber's avatar
Graham Huber
217 posts
14 years ago
Graham Huber's avatar Graham Huber

Using EE 2.2.1 Build 20110705

$this->EE->input->cookie(); appears to not work?

I’m using this plug-in: http://old.devot-ee.com/add-ons/cookie-plus/

It’s pretty basic… The :get parameter performs a simple grab and check of a given cookie, using $this->EE->input->cookie(); – However, this seems to be failing because $this->EE->input->cookie(); is always returning null, even when remove all other code and explicitly name a cookie I know is set:

e.g.

$name == "exp_last_visit"; 
$this->EE->input->cookie($name);

Could something be breaking EE->input->cookie()?

[Mod Edit: Moved to the Development and Programming forum]

       
Graham Huber's avatar
Graham Huber
217 posts
14 years ago
Graham Huber's avatar Graham Huber

Possibly related to this?

http://ellislab.com/forums/viewthread/191666/

       
Graham Huber's avatar
Graham Huber
217 posts
14 years ago
Graham Huber's avatar Graham Huber

I’ve noticed I’m also having problems with cookies in the CP.

For instance, if I change CP session to “Cookie Only”, I can’t switch MSM sites. Likewise, when a session times out, I can’t log back in until I clear cookies.

If I had to guess, I’d say that there is something causing a general issue with EE->input->cookie. I just tried created the most basic template I could, with PHP enabled, and EE->input->cookie did not work.

I tried disabling Extensions as well, with no effect. I also loaded each plug-in to see if there were any errors…

Is there any way I can debug this? Or PM CP access?

Thanks

       
the3mus1can's avatar
the3mus1can
426 posts
14 years ago
the3mus1can's avatar the3mus1can

Try:

$name == "last_visit"; 
$this->EE->input->cookie($name);

$this->EE->input->cookie() automatically adds the exp_ prefix.

       
Graham Huber's avatar
Graham Huber
217 posts
14 years ago
Graham Huber's avatar Graham Huber

Also, someone else is complaining on this cookie plug-in page that it’s not working with EE 2.2….

http://old.devot-ee.com/add-ons/cookie-plus/ (see Reviews).

I don’t know if it’s related or not… But I need to get the bottom of this!

Thanks for your assistance!

       
Graham Huber's avatar
Graham Huber
217 posts
14 years ago
Graham Huber's avatar Graham Huber

@the3mus1can

AHA!

You’re right!

When I added “exp_” to my cookie name, it worked.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.