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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T17:58:16+00:00 2026-06-01T17:58:16+00:00

I am having issues with using the session component in cakephp. They worked fine

  • 0

I am having issues with using the session component in cakephp.
They worked fine throughout the site, when on a dev site on a different server.

After uploading the final version on the new server, it seems that the session will not start in certain controllers. Only on two controllers is this happening, but nothing seems to be done differently on these controllers – except possibly the fact that only these two controllers are using a custom file uploader component. Have tried disabling this and nothing changed.

The website is an ecommerce system, with the problems mainly occuring when trying to add an item to the basket, which is stored in a session. this session is remaining blank, whereas on the dev site worked a charm.

I am also using the auth component to login/logout, and although these 2 areas are not required to be logged in to function, they cause it to switch to logged out whenever they are loaded – and this then switches back by itself when any other areas of the site are accessed. The auth and session components are loaded in the appcontroller.

Thanks!

  • 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-01T17:58:18+00:00Added an answer on June 1, 2026 at 5:58 pm

    I’ve had a similar problem before now, and for me I was under the same impression as @starlocke that something needed kick starting. Instead of using Cake’s Session component I used the session_start() command, after checking that $_SESSION was not defined. For example:

    if(!isset($_SESSION)) session_start();
    

    This was placed inside the beforeFilter() method of the AppController class.

    I then also had a problem where it was saying it couldn’t start the session because of there already being output to the server, this was solved for me by deleting any closing ?> tags inside controllers, as these aren’t required by php and stop any unneeded output being sent to the browser like in this case.

    Further reading on php closing tags:

    • Why I don’t use closing PHP tags
    • PHP closing tag
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having users login to my site using Facebook. They are sent away from
I'm forced to upgrade to Python 2.6 and am having issues using Numerical Python
I'm having some issues using mysqli to execute a script with SELECT,DELETE,INSERT and UPDATE
I am using C. I am having issues with using pointers for the fscanf
I am having some issues with using the OrderBy extension method on a LINQ
Hey I am having some issues while using Nggalley plugin for wordpress the plugin
I'm having issues creating an ActionLink using Preview 5. All the docs I can
I am having issues with loading external javascript using JQuery. Every time when I
I'm having issues while populating a combobox using DirectStore, the combobox is as follow:
Using the SharePoint 2010 RC I am having issues canceling the deletion of a

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.