Getting randomly logged out when using ckeditor in cakephp 1.2
Asked Answered
M

2

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.

Millford answered 22/3, 2013 at 19:14 Comment(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 ?Ruffianism
@Ruffianism there is no https in this application, all in http.Millford
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?Eastwood
@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/GnPd3L13Millford
Do you have Auth or Security enabled? Can you share the code of the action that the form is submitted to?Hypermeter
@Nunser, sorry for the delay. Here is everything: pastebin.com/fbrUCuPF I will start the bounty againMillford
Few questions, I don't see any log-related actions in the code you shared, so I have to ask: how do you know you're logged out? Because you're redirected to a specific page or is there a user-related session part not in your code? And when you say "edit some html[...] no changes, sometimes I got logged out[...]", does it happen randomly with the same menu id, or if you keep trying with that same id, it's always the same result?Hypermeter
I know I am logged out because I am redirected to this page pastebin.com/BaXVWYQf. By "edit some html[...] no changes, sometimes I got logged out[...]" I mean "it happen randomly with the same menu id"Millford
H
4

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.

Hower answered 24/5, 2013 at 8:45 Comment(5)
Removed all closing tags and whitespaces from the end of the file, there is no debug method and the error is still happening.Millford
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?Hower
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?Millford
try changing your security level to medium. i have experienced also some unexpected logout when the security level is set to high.Hower
It seems to be solved! I will ask my user to test it as well then I'll give you the points :)Millford
E
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

Eastwood answered 2/4, 2013 at 6:57 Comment(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.Millford
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?Eastwood

© 2022 - 2024 — McMap. All rights reserved.