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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T14:33:58+00:00 2026-05-26T14:33:58+00:00

I have search and search but no answer I am using Zend Framework to

  • 0

I have search and search but no answer I am using Zend Framework to create a user and on success store the record in zend auth so they are automatically logged in.

I have the create user working perfect but after the success I need to start the _getAuthAdpater() and sign the user in.

I have implemented the below code but it will not store the users data in the session. Here is my function.

public function registerAction()

$proUser = new Application_Model_DbTable_ProUser;
$userId = $proUser->addProUser($data['email'], $data['name'], $data['password']);if($userId){

                // add new row into proBasic
                $proBasic = new Application_Model_DbTable_proBasic;
                $proBasic->addProBasic($userId);

                // add new row into proService
                $proService = new Application_Model_DbTable_proService;
                $proService->addProService($userId);                

                // Create auth session for proUser
                $adapter = $this->_getAuthAdapter();
                $adapter->setIdentity($data['email']); 
                $adapter->setCredential($data['password']);

                $auth = Zend_Auth::getInstance();
                $result = $auth->authenticate($adapter);

                if ($result->isValid()) {

                    $user = $adapter->getResultRowObject(array(
                        'proId',
                        'proName',
                        'proEmail',                     
                    ));                     
                    $auth->getStorage()->write($user);
                    return true;

                }

                return $this->_redirect('/auth/probasic/');
            }

Here is the _getAuthAdapter() function:

    private function _getAuthAdapter()
{

    $authAdapter = new Zend_Auth_Adapter_DbTable(Zend_Db_Table::getDefaultAdapter());
    $authAdapter->setTableName('proUser')
                ->setIdentityColumn('proEmail')
                ->setCredentialColumn('proPassword');       

    return $authAdapter;            
}

I am getting no errors for this code but it isnt store the users details in the Auth. I have found 100’s of example of how to create a login/sign up system in Zend and none of them automatically login the user, so I am wondering if I am trying to do something different.

Cheers

J.

  • 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-26T14:33:59+00:00Added an answer on May 26, 2026 at 2:33 pm

    You don’t really need to authenticate them if you’re creating the session immediately after registration. What happens if you replace all your code after $proService->addProService($userId) with just this:

    $auth = Zend_Auth::getInstance();
    $auth->getStorage()->write($data['email']);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been trying to create a new google custom search engine, but when
This is kind of a weird problem, but I have to create a search
I have not been able to locate the answer using Google search. I know
Firstly, I have search Stack Overflow for the answer, but I have not found
I have search the previous question but couldn't find the answer. Dynamically generated html:
I have search through the web to figure this out but no luck. I
I have a problem and search for a solution on Google but can't find
I have a timestamp and I want to search for a single date but
Have seen multiple posts on this but I can't see any which answer my
I have a problem and I think a NoSQL solution is the answer but

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.