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

  • Home
  • SEARCH
  • 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 8718187
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T06:28:53+00:00 2026-06-13T06:28:53+00:00

I have a CakePHP website with its own login system. In the same server

  • 0

I have a CakePHP website with its own login system. In the same server (but different folder), I have a WordPress blog. A user that is already logged in the CakePHP website can click a link that takes him to the WP blog and logs him into the blog at the same time. All this works perfectly.

The problem comes when going back to the original CakePHP website. If I place a link in the blog pinting to the website and the user clicks it, he is taken to the website, but his session there is lost, meaning that he has to log in again.

Is there any way to prevent that from happening? Shouldn’t the session be still valid even if the user leaves the website? It’s not that it expires, I have it set to 30 min.

This also happens even if the user doesn’t access the blog via the link in the website. If I log into the website, then open a new tab and enter the blog (without even logging in), and click the link to the website, the session in the website is lost. Well, there’s a new session actually (I’ve been printing the session id and it changes).

Any ideas on how to keep the session open would be useful.

Also, just in case, here’s the script that I use to log in a user from the website into the blog:

$sid = $_GET['sid'];
session_id($sid);
session_start();

if (isset($_SESSION['Auth']['User']['username'])) {

    require('../blog/wp-blog-header.php'); //includes wordpress functions

    $username = $_SESSION['Auth']['User']['username'];

    $user = get_userdatabylogin($username);
    wp_set_current_user($user->ID);
    wp_set_auth_cookie( $user->ID );
}

header("Location: http://myblog.com/"); //Redirect user to the blog
  • 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-13T06:28:54+00:00Added an answer on June 13, 2026 at 6:28 am

    Check your Security level. In some cases, it does a check on the ‘referer’ site. If you are coming from a WP blog, it might have a fit about that. That is what I am assuming is happening since it is generating a new session id.

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

Sidebar

Related Questions

I have a CakePHP website with its own login system using the Auth component.
I have a website already running made with CakePHP, which has its own login
I have a website made with CakePHP 1.3.7. This website has it's own login
I have a CakePHP website that acts as a questionnaire. It moves the user
I'm trying to make a login page for my CakePHP website, and my user
I'm currently porting a website from WordPress to CakePHP, and I have a problem
My website is http://localhost/carsales/ I have finished my cakephp website but my index page
I have two contact forms in my CakePHP application -- one with its own
I have a CakePHP app that is being moved to Sql Server from MySql.
I have a cakePhp application built, and now I'm creating a simple blog based

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.