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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T18:15:17+00:00 2026-05-20T18:15:17+00:00

I am making a users profile page and if i route it like this

  • 0

I am making a users profile page and if i route it like this

 Router::connect('/users/profile', array('controller' => 'users', 'action' => 'profile'));

then $this->Auth->user() work fine in UsersController->profile() but if iroute it like this

Router::connect('/pages/profile', array('controller' => 'pages', 'action' => 'profile'));

then it doesnt in PagesCotroller->profile() the profile function is the same in both cases

my app controller:

 class AppController extends Controller {
     var $components = array(
         'Auth' ,
         'Acl',
         'Session',
         'Cookie'
     );
     var $userdata = array();
     function beforeFilter(){
             $this->Auth->userModel = 'Users';

         $this->Auth->loginRedirect = array();
         $this->Auth->allow('display');
             $this->Auth->allow('index');

             var_dump($this->Auth->user());
             parent::beforeFilter();
     }
     function isAuthorized() {
        return true;
     }


}

and var_dump actually works if i go to /users/profile and doesnt if i go to /pages/profile
without any additional logging in or anything

$this->Auth->allow() works properly in both controllers by the way, so Auth component is available in both

here’s pagescontroller

class PagesController extends AppController {
        var $components = array('RequestHandler');
    var $name = 'Pages';
    var $helpers = array('Html', 'Session','Form','Ajax', 'Jquery');

    var $uses = array('Users');

        function beforeFilter() {
            parent::beforeFilter();
            $this->Auth->allow('profile');
        }

        function beforeRender() {
            parent::beforeRender();

        }

        function profile(){

                var_dump($this->Auth->user());
        }
}
  • 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-20T18:15:18+00:00Added an answer on May 20, 2026 at 6:15 pm

    I found the answer it was captcha component. It started session every time it was called and it wass called from all the controllers except users. So the user log in data was not preserved.

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

Sidebar

Related Questions

So I'm making a user profile page for my app. However I want the
For my current project in codeignitor I needed to make user profile like this
I'm making a profile page in which I'm allowing the user to drag certain
Im making a login/logout class that logs users in, sets cookies based on user's
I am making a Firefox extension and would like to give my users more
I would like to display the users profile picture inside of my applications canvas
I'm making a user profile edit form for my website, and I want to
I built a LAMP web application that let's users create their own profile page
What I am making is basically is a user profile that has a text
I'm making a website that mail users when a movie or a pc game

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.