Wednesday, January 21, 2015

Re: Session date missing after redirect

Hi Ken ..

You may be having the same issue that I had .. you replied to my post as well .. I found out that cake checks for any header (or debug/echo)  being sent before the session starts will cause the session not to start your addition of the Cakesession::Start just forces the session start which will work but not the solution.. Look for pr/echo statements that send output to the webserver that will cause the cake session to not start ..

Cheers

Dave W

On Sunday, January 18, 2015 at 11:51:55 AM UTC-5, Ken Winans wrote:

First let me say I have looked for answers to this on this forum and in the Book but nothing seems to fit. I have also posted this question on StackOverflow and I apologize if any one is offended by my posting it both places.

I have 3 working apps that I am moving from one production server to another. All 3 of the apps use Auth. All 3 work fine on the original server. On the new server, one of these apps works as it should (it happens to be CakePHP 1.3) i.e. after logging in the user's session data (like user name and role) is available in my PagesController after the redirect.

On the other 2 apps (one is 1.3 and the other is 2.3), after the login redirect, the session data seems to be gone. I have confirmed this by debugging $this->Auth->user() in the PagesController. I have also confirmed that the session data IS there after the call to $this->Auth->login() in the UsersController but is gone after the redirect.

Because these are apps that I have been using for years, I am confident that the problem is some configuration issue on the new server - something like a directory permission. I have reviewed all permissions and can't find a problem. I have compared the permissions on the one app that works to the ones that don't and I'm stumped.

Any suggestions?

I have tired things I have found in other posts such as setting Security.level to low, turning output_buffer off, etc. Nothing has had any effect and the fact that a) this app works on 2 other servers and b) one of the 3 apps works makes me think it is a configuration problem, not a code problem.

Simple question: where does CakePHP store session cookies by default. The Book says it is '/'. But what is that relative to, DOCUMENT_ROOT? I have looked everywhere (on the app that works) that could possibly be interpreted as '/' relative to my app (DOCUMENT_ROOT, app, webroot, etc.) and I don't find any files that look like session cookies.

Thanks in advanced for any help you can offer.

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

No comments: