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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T16:29:22+00:00 2026-06-04T16:29:22+00:00

I have followed the authentication tutorial in the cakephp documentation and created a working

  • 0

I have followed the authentication tutorial in the cakephp documentation and created a working login system.

One thing I’m trying to do is have the user redirected to the action they were trying to access initially when not logged in, after they complete login.

I believe the page they were visiting is supposed to be written to Auth.redirect within the session by the startup function in the Auth component, however this doesn’t appear to be working.

In my users controller I have added the following to the beforefilter:

$this->Auth->allow('add', 'login');

Therefore when trying to access the edit action I’m redirected automatically to the login action.

In the login action, I’ve included:

debug($this->Session->read());
debug($this->referer());

This is outputting the session information, and in this session there is no mention of Auth.redirect so neither the Auth function or myself is unable to use this to redirect the user with.

I’ve tried using $this->referer but for some reason when being redirected automatically by the auth function the referer isn’t being tracked either.

Does anyone know a reason why auth.redirect might not be being written and why $this->referer isn’t being populated when redirected by the auth function?

I must note I am on a windows machine using WAMP. However my add action redirects to login after success and debug($this->referer()); picks up the redirect URL when this occurs so the headers must be working fine.

Further Notes:

I’ve identified the issue with CakePHP by looking through the sessions stored in the database.

It seems that the auth.redirect is stored in the session, however for some reason a new session is generated when the user is redirected clearing the previous data.

Is there anyway to stop CakePHP creating new session ids for users?

  • 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-04T16:29:23+00:00Added an answer on June 4, 2026 at 4:29 pm

    I’ve identified the issue as to why auth.redirect wasn’t working.

    I had set a custom session cookie name in core.php, for some reason the session component doesn’t work with the custom cookie name and therefore creates a new session on every page.

    If you are experiencing problems with sessions and you have a custom session cookie name, reset it to default and it will work.

    I will be submitting this as a bug to CakePHP.

    Further Note

    I identified the issue was occuring because of a . in the cookie name, without this . the custom cookie name performs as it should.

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

Sidebar

Related Questions

I'm working on a user authentication thing for a web site. Having read the
I am trying to integrate openid authentication in asp.net 4 and have followed the
I am having trouble trying to secure ELMAH. I have followed Phil Haacked's tutorial
I have followed the article here http://chrisdail.com/2008/08/13/http-basic-authentication-with-apache-cxf-revisited/ I now have a working interceptor for
I followed the tutorial for setting up simple authentication (http://book.cakephp.org/2.0/en/tutorials-and-examples/blog-auth-example/auth.html) and I am having
I am trying to put Facebook Login button on Codeigniter platform. I have followed
I am using the authlogic gem for authentication. I have followed the steps at:
I followed RailsCasts authentication from scratch (http://railscasts.com/episodes/250-authentication-from-scratch-revised) using the bcrypt-ruby gem and have the
I have followed this tutorial which allowed me to create a Silverlight DataGrid that
I have followed Apple's documentation on localizing iPhone software, using the genstrings ruby script

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.