9

I have an old cakephp-1.2 application in production. This system has a screen where html content can be edited using ckeditor 3.2. The problem is that almost every time when I try to edit some html content I got logged out when submitting the form, the content is not saved when this happens.

Interesting enough I go to edit some html content and make no changes at all in ckeditor then hitting submit sometimes I got logged out and sometimes it works as expected.

8
  • Is the application under https ? I'm not sure with Cake1.2, but at least with later versions, depending on Session configuration you may loose session if you are logged in under https and you make some requests to http. Would CKEditor make random requests to http ?
    – nIcO
    Mar 25, 2013 at 7:50
  • @nIcO there is no https in this application, all in http. Mar 25, 2013 at 18:27
  • I sounds more like an expiring session problem? did you check your sessions? I would guess that if it's a Ckeditor problem it would happend every time. If not try to find out what is exactly the difference between the times that it happen. We need this infromation to help you. Also you could try to set an echo in your post script on the first line to see if it enters at all?
    – Spons
    Mar 26, 2013 at 17:02
  • 1
    @spons here is my config file pastebin.com/rwE179ex, here is a $_POST of a data that does not cause the log off pastebin.com/bxrS5mBw and here is a $_POST of a data that does cause the log off pastebin.com/GnPd3L13 Apr 1, 2013 at 22:44
  • Do you have Auth or Security enabled? Can you share the code of the action that the form is submitted to?
    – Nunser
    May 14, 2013 at 15:55

2 Answers 2

4
+100

I encounter the same problem before just cleaned up the entire code and made sure there wasn't any unnecessary whitespace or unused methods such as debug or php close tag. can you check all your Model.php and remove all php close tags? Hope it solves your problem too. It works fine with me.

5
  • Removed all closing tags and whitespaces from the end of the file, there is no debug method and the error is still happening. May 25, 2013 at 22:37
  • 3
    what is your app Configure::write('Security.level', ''); is set to? or the Configure::write('Session.timeout', '120'); settings? Have you try to adjust the Session.timeout to a longer span of time? May 27, 2013 at 11:26
  • Configure::write('Session.timeout', '1800'); and Configure::write('Security.level', 'high');. I think the timeout is high enough, but for the security I don't know. Should I change it? May 27, 2013 at 15:09
  • try changing your security level to medium. i have experienced also some unexpected logout when the security level is set to high. May 28, 2013 at 3:08
  • It seems to be solved! I will ask my user to test it as well then I'll give you the points :) May 28, 2013 at 15:12
0

I really don't no anything about CakePHP but did you already try to fill these values in the post that cause the log off..

["CAKEPHP"]=>
string(26) "xxx"
["__utma"]=>
string(54) "xxx"
["__utmb"]=>
string(26) "xxx"
["__utmc"]=>
string(9) "xxx"
["__utmz"]=>
string(70) "xxx.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none)"

Because this is the only difference between the 2 Posts. Now i think that you are going to tell me that you don't know how to set them. But if i'm right, this is the session your working on?

Question?: And these 2 posts come from different pages? If so what is the difference on these 2 pages? Did you enable session on both pages?

Possible Solution: Anyway look at this page, what describes a solution for redirecting problems.. I really don't think that it has anything to do with CKEditor. Or does CKEditor return the above posted data? Also this url could help you possibly: Stackoverflow Topic

2
  • 1) I can manually set them, but I should not. Sorry, can you rephrase your question? 2) Both posts come from the same page, the field that uses CKEditor is 'html'. I am not manually setting/handling the session anywere in my code, it is enabled for this page. Apr 2, 2013 at 19:44
  • Sorry i can't really help you any furtur, i don't have the time to look at it. but it feels like searching for a needle in a haystack. Maby you can try to overwrite the session manualy As temporal bug fix?
    – Spons
    Apr 3, 2013 at 7:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.