Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6603651
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T19:02:36+00:00 2026-05-25T19:02:36+00:00

in controller i try this, and print $cookieee,its give me array $this->Cookie->write(‘User’, $cookie, true,

  • 0

in controller i try this, and print $cookieee,its give me array

$this->Cookie->write('User', $cookie, true, '+2 weeks');

$cookieee = $this->Cookie->read('User')
echo "<pre>";
print_r($cookieee);
echo "</pre>";

but
My question

when i print it any view file ,it doesnt print any values.

i try to print it by using below

echo "<pre>";
print_r($cookie);
echo "</pre>";
echo $cookie['username']."=cokie=";

and

$cookieee = $this->Cookie->read('User');
echo "<pre>";
print_r($cookieee);
echo "</pre>";
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T19:02:37+00:00Added an answer on May 25, 2026 at 7:02 pm

    your view does not have access to the cookie.. Basically $this is referring to two different things in the case of your controller and your view.. thus basically set it in a model that is passed to the view i.e viewmodel and then use that in your view.

    Not famililar with PHP hence no code but this is my understanding based on using MVC framework in .NEt

    I guess this question tells you how to do the same in PHP: how to read cookie value in cakephp view file

    and if you want to break the MVC pattern here you could use: $_COOKIE[<cookie_name>].

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want my controller to return the right HTTP response code when the user
In my view controller's -viewDidLoad method, I call [myTextField becomeFirstResponder]; This works like a
Ive got some kind of a problem here. When I try this function, it
I get all the time this error: exception 'Zend_Controller_Dispatcher_Exception' with message 'Invalid controller specified
I have implemented a controller to create new users. When it creates the user
This is the controller class @Controller public class ReportController { @RequestMapping(/reports.htm) public void onSubmit(ModelMap
I have a controller which renders a view (~/Views/Component/Create.aspx) no problem. When this view
When I try to do like below and I have a RequestMapping controller class
I'll just try to outline this as high level as I can. I am
So i have two view controller in FirstViewController and SecondViewController in FirstViewController NSMutableArray *array;

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.