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 8513749
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T04:40:01+00:00 2026-06-11T04:40:01+00:00

I checked this Cakephp cookie always get deleted automatically but, no go. That is

  • 0

I checked this Cakephp cookie always get deleted automatically but, no go. That is not exactly what I’ve been looking for.

The cookie which Auto Login uses is getting deleted.

Here is what did:

    public function login( ) {
    if ($this->Auth->user('id')) {
        $this->redirect(array('action' => 'dashboard'));
    }

    if ($this->request->is('post')) {
        if($this->request->data['User']['auto_login']):
            $this->AutoLogin->write($this->request->data['User']['email'],
            $this->request->data['User']['password']);
            endif;
        if ($this->Auth->login( )) {
            //$this->redirect(array('controller' => 'users', 'action' => 'edit'));
            return $this->redirect($this->Auth->redirect( ));
        }
        else 
        {
            $this->Session->setFlash(__('Username and Password is incorrect'), 'default', array( ), 'auth');
        }
    }

    else {
        if($this->AutoLogin->read()):
            $AllData = $this->AutoLogin->read();
            $AllData['username'] = 'email';
            $AllData['password'] = 'password';
            $check = $this->User->find('first', array('username' => 'email', 'password' => 'password'));
            if($check):
                $this->Auth->user($check);
                $this->Auth->redirect();
            endif;
            $this->redirect(array('action' => 'login'));
        endif;
    }

It sets cookie, it does every damn thing!

But, on browser exit, it just disappears! Yes, tried with variety of browsers and also checked if browser settings is doing it.

My AppController is loading:

public $components = array('AutoLogin','Auth' => array('autoRedirect' => false), 'Cookie', 'RequestHandler', 'Session', 'Facebook.Connect' => array('model' => 'User') );//, //'DebugKit.Toolbar');

Now, here is the catch, when I check for Resources under Inspect Element, it shows me 2 things: PHPSESSID and CakeCookie[autoLogin] , PHPSESSID – type is session and expires – blank. CakeCookie type is cookie and expires after a month!

Since it ‘looks’ like native PHP, I thought of checking for session_start() function and I found it! It was Facebook component but, disabling it, did prevent PHPSESSID from coming but , still cookie would get deleted on browser exit.

Please advice.

Thanks in advance.

  • 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-06-11T04:40:03+00:00Added an answer on June 11, 2026 at 4:40 am

    Open Facebook.php file in Facebook plugin files.

    On line 4 or 5, under __construct, comment out the line which says session_start();

    Ideally, CakePHP loads all the plugins which results in PHPSESSID getting set. Comment this out and even Facebook will effectively work.

    Also, make sure that you create a folder called ‘sessions’ under your tmp folder and mark it chmod -R 0777 sessions/ , refresh your application.

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

Sidebar

Related Questions

I checked this question , but it's not what I'm looking for. I'm trying
I have already checked this question but could not find what I'm looking for.
I have checked this similar question, but the suggestions did not solve my problem:
Using the following steps: (I have checked this similar post , which does not
I've already checked this.. similar question but I am not convinced about the answers...
I have a 2884765579 bytes file. This is double checked with this function, that
I followed this instruction but not worked for me. I just wanna install and
My problem is that memcache logic inside my cakePHP application is not working on
Nevermind, I just figured out that CakePHP had to re-set the cookie because it
I checked this post already. But it doesn't answer my question. I want to

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.