Re: Session date missing after redirect
Mark, Thanks for the links to the tools. No, I hadn't searched for tools to handle this but I was getting ready to. I need to go back to several more projects before transferring them so this will be a help. It amazes me how differently this problem (white space after closing tag) can manifest itself. I had known about it for years but it never seemed to affect me until just recently. Ken -- 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+unsubscr...@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.
Re: Session date missing after redirect
Hope you didnt have too many files to manually check. You know that there are tons of tools for that, right? E.g. https://github.com/dereuromark/cakephp-tools/blob/master/Console/Command/PhpTagShell.php or https://github.com/dereuromark/cakephp-tools/blob/master/Console/Command/WhitespaceShell.php mark Am Freitag, 23. Januar 2015 19:44:48 UTC+1 schrieb Ken Winans: > > It wasn't a call to pr() or an echo. It was whitespace following a closing > PHP tag. I just went through every file and got rid of every closing PHP > tag. Should have done it a long time ago. > > I only have myself to blame. :-o > -- 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+unsubscr...@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.
Re: Session date missing after redirect
Hi Ken .. Glad to hear that my hint helped it took a long time tracing through code to find it, as it sounds like you had a similar issue, but related to white space - it's very difficult to spot the real issue,as you just get blackholed, with no indication why .. Now that the issue has been documented, other that may run into the issues have a better shot at fixing it .. Cheers Dave On Fri, Jan 23, 2015 at 1:44 PM, Ken Winans wrote: > It wasn't a call to pr() or an echo. It was whitespace following a closing > PHP tag. I just went through every file and got rid of every closing PHP > tag. Should have done it a long time ago. > > I only have myself to blame. :-o > > -- > 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 a topic in the > Google Groups "CakePHP" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/cake-php/ORfK1b9AYTU/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > cake-php+unsubscr...@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. > -- 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+unsubscr...@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.
Re: Session date missing after redirect
It wasn't a call to pr() or an echo. It was whitespace following a closing PHP tag. I just went through every file and got rid of every closing PHP tag. Should have done it a long time ago. I only have myself to blame. :-o -- 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+unsubscr...@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.
Re: Session date missing after redirect
Thanks, I will do that. Ken -- 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+unsubscr...@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.
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+unsubscr...@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.
Re: Session date missing after redirect
I have found a work-around for this problem. I found that Sessions were not being started (on redirect after Auth login) on the server that had PHP 5.4.36 and Cake 2.x. My first work-around was to set session.auto_start=1 in my php.ini file. The Sessions and Auth login worked properly then. I then set session.auto_start back to 0 (the default) and put CakeSession::start() in the beforeFilter() in my AppContoller. This works as well. Why this should necessary, I have not figured out yet. I will keep looking into it and post any conclusions here. Ken -- 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+unsubscr...@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.
Re: Session date missing after redirect
Euromark, Thanks for your response. I updated my version of CakePHP to the 2.6.1. Now I can change the setup so that session cookies on the server are written to /app/tmp/sessions. I now see the cookies - each with a name like sess_abd5g143. The client-side cookie content is the GUID that matches the GUID that is part of the server-side cookie name. My session setup (at least on the CakePHP side) is very much default except that I now have Session.default='cake'. The server is a WHM/Cpanel type. Very generic too. I have setup another 2.x app that uses the same UsersController code and I get the same symptoms. I agree it seems like a server problem - but where do I look? Especially since on the same server a 1.3 app works. I have asked the company I lease my servers from to help. Ken -- 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+unsubscr...@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.
Re: Session date missing after redirect
You must have some special session setup. For no one else this happens - ever. Try to set up a completely fresh system and debug that one piece by piece. If that happens there too its most likely a server issue. Otherwise it is probably a misconfiguration in your configs in CakePHP etc. mark Am Montag, 19. Januar 2015 23:15:29 UTC+1 schrieb kdubya: > > A kind person on IRC suggested that the problem might be fixed by going to > the latest version of Cake. So I updated to 2.6.1 and the problem still > exists. > -- 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+unsubscr...@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.
Re: Session date missing after redirect
A kind person on IRC suggested that the problem might be fixed by going to the latest version of Cake. So I updated to 2.6.1 and the problem still exists. -- 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+unsubscr...@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.
Re: Session date missing after redirect
Another factor that might have a bearing on this: the old server had PHP 5.2.17 - the new server has 5.4.36. In my original post I said I had a CakePHP 2.3 and a 1.3 app that were misbehaving. When I switched the 1.3 app to use Session.default='cake', it started working. Now I can switch it back to 'php' and it still works. The 2.3 app still does not retain the session data after redirect (everything else works). Weird -- 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+unsubscr...@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.
Re: Session date missing after redirect
I have tried changing the Session settings in core.php. I have tried both Configure::write('Session', array('defaults' => 'cake')); and 'database'. Each time I do that my error.log fills up with repeated errors that begin: 2015-01-18 17:15:13 Error: [CakeSessionException] Unable to configure the session, setting session.auto_start failed. -- 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+unsubscr...@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.
Session date missing after redirect
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+unsubscr...@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.