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

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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T09:29:04+00:00 2026-06-03T09:29:04+00:00

Is there anything like a session ID that prevents the same session for having

  • 0

Is there anything like a session ID that prevents the same session for having multiple requests/threads at a time? How does it works?

I have a loop in a method of one of my controller classes of my application that loops waiting for some actions (checking database).

I you need to see code, the following is an excerpt of the code inside the method:

// Times in hundredths of seconds.
$timestamp = number_format(microtime(TRUE), 2, '', '');
$closing_time = $timestamp + ($auditorium_lot_timeout * 100);

// Loop until time's up.
do
{
  usleep(250000); // Sleep 250ms to unload the CPU.
  if (Model_Event::count_new_bids())
  {
    // Etc, etc, etc...
    // Change closing time to wait 10 seconds more.
  }
} while (number_format(microtime(true), 2, '', '') < $closing_time);

// After time's up, continue with closing the bids definitely.
// Perform some more actions.

The method to which this excerpt belongs is requested by AJAX. It’s purpose is to close bids on an auction but wait some seconds before closing to give chance for last bids. For that it loops a preconfigured amount of time (like 30 seconds) and while it’s looping, the entire application can’t recieve any other request from the same user. Why is that? It’s blocking me very hard because this user is the operator/auctioneer of the live auction and must send “bid” requests for users that are not participating online (but presential in a real auditorium), while he triggered this loop.

Update: JS request code is abstracted by CanJS models.

  • 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-06-03T09:29:06+00:00Added an answer on June 3, 2026 at 9:29 am

    That happens because built-in sessions mechanism locks session file if some request still uses it.

    So the possible solution for you is to release session in long living code by session_write_close()


    PS: oh, haven’t seen there is such comment from @chris. As a justification it is not a stealing an answer I put this link, that proofs I answered similar question before: https://stackoverflow.com/a/6405685/251311

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

Sidebar

Related Questions

Is there anything in Python that works like the final keyword in Java -
Is there anything like the weblogic console, but for administrating an OTP application (written
is there anything like this in JDK or Apache Commons (or in other jar)?
Is there anything like boost::thread_group in C++11? I'm just trying to port my program
Is there anything like Jsoup but instead of parsing HTML, I need to parse
Is there anything in boost libraries like binary? For example I would like to
Is there anything in apache commons to convert a Object to byte array, like
is there anything built-in in Django templates that will allow me to compare two
Is there anything special I have to do to a JSON object before I
I am currently developing a system that has need for a session time out

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.