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

  • Home
  • SEARCH
  • 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 5947353
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T16:57:06+00:00 2026-05-22T16:57:06+00:00

It’s the third time that I’m editing this post, after more testing and debugging

  • 0

It’s the third time that I’m editing this post, after more testing and debugging I keep finding out new stuff. Here my situation:

I have an method thinker that takes a while to process. Because of that I decided to call it via Ajax, and show an indicator to the user. Up to that point – works great.

Another thing I’m trying to do, is actually show the user the progress of “thinking”, in percentage or just ticks, whatever.

It’s not to difficult to do, because thinker has a loop, and in every iteration it saves new thoughts to the database.

So basically – the counter just show the number of “thoughts” (tied to the specific id).

The problem is, that the callback option doesn’t get called.

Well – scratch that – it does get called, but only twice. Before the request (shows zero) and after the thinker is done thinking, when there is no use for it anymore (show the full amount).

Here’s the simplified code:

<span id="indicator" style="display: none;"><img src="/img/ajax-loader.gif" alt="" /></span>
<span id="progress"></span>
<span id="clicker" style="cursor: pointer;">Do it!</span>

<script type="text/javascript">
//<![CDATA[
Event.observe('clicker', 'click', function(event) {
  new Ajax.Request(
    '/examples/thinker/123', 
    {asynchronous:true, evalScripts:true, onComplete:function(request, json) {Element.hide('indicator');}, onLoading:function(request) {Element.show('indicator');}}
    );
  new Ajax.PeriodicalUpdater(
    'progress', 
    '/examples/counter/123', 
    {asynchronous:true, evalScripts:true, frequency: 2}
    );
  });
//]]>
</script>

EDIT:

Through the use of Firebug XHR console I managed to get into this a little bit deeper. I actually went with jQuery (just to test, but it didn’t help).

The problem is with CakePHP I guess. I mean – when I created an identical scenario with basic PHP it works at the same time. When I do it with Cake, the counter will get called, then the thinker will get called, and the counter will get called every two seconds, but will only respond after the thinker is done thinking.

Is it possible that Cake won’t manage to handle the second request until the first one is finished?

Regards,
Paul

  • 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-05-22T16:57:07+00:00Added an answer on May 22, 2026 at 4:57 pm

    Well, as it turns out, the problem is in fact with Cake. By default, CakePHP stores sessions in file (default from php.ini actually). It sort of comes down to:

    One user can’t run two CakePHP instances at the same time with the default session storing option.

    Changing:

    Configure::write('Session.save', 'php');
    

    to

    Configure::write('Session.save', 'cache');
    

    Seems to do the trick.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
For some reason, after submitting a string like this Jack’s Spindle from a text
I'm trying to create an if statement in PHP that prevents a single post
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
this is what i have right now Drawing an RSS feed into the php,
I've got a string that has curly quotes in it. I'd like to replace
I have a French site that I want to parse, but am running into
I want use html5's new tag to play a wav file (currently only supported

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.