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 499351
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T05:58:36+00:00 2026-05-13T05:58:36+00:00

I have a problem wtih session_start() on primary server. When I load page for

  • 0

I have a problem wtih session_start() on primary server. When I load page for the first time, it takes less than 1 second to complete request. If I’ll wait for approximately 12-15 seconds and then reload page, time of loading will be the same. But when I’m trying to refresh page after, for example, 3 or 5 seconds after initial loading, time of the server’s response equals 10 seconds.

I made some tests to define a bottleneck in my script and I found out, that function session_start() executes for 9.8 seconds. I’m using PEAR package HTTP_Session2. Here is code snippet:

HTTP_Session2::useCookies(SESSION_USE_COOKIE);
/* Next line was added to make logging of execution time possible. */
self::writeToFile('HTTP_useCookies(1) -> '.self::getWorkTime()); 
HTTP_Session2::start("SID");
self::writeToFile('HTTP_start(2) -> '.self::getWorkTime());
HTTP_Session2::setExpire(time() + SESSION_EXPIRE);
self::writeToFile('HTTP_setExpire(3) -> '.self::getWorkTime());

Text of the logs:

//First loading (13:34:35)
HTTP_useCookies(1) -> 0.00038
HTTP_start(2) -> 0.00077
HTTP_setExpire(3) -> 0.00090

// Second loading (13:34:39)(4 seconds later)
HTTP_useCookies(1) -> 0.00029
HTTP_start(2) -> <<<<<< 10.80752 >>>>>
HTTP_setExpire(3) -> <<<<<< 10.80780 >>>>>

//Third loading (13:34:56)
HTTP_useCookies(1) -> 0.00041
HTTP_start(2) -> 0.00071
HTTP_setExpire(3) -> 0.00083

So I found, that problem is in the HTTP_Session2::start() function. Code of the function HTTP_Session2::start():

public function start($name = 'SessionID', $id = null)
{
  self::name($name);
  if (is_null(self::detectID())) {
    if ($id) {
      self::id($id);
    } else {
      self::id(uniqid(dechex(rand())));
    }
  }
  session_start();
  if (!isset($_SESSION['__HTTP_Session2_Info'])) {
    $_SESSION['__HTTP_Session2_Info'] = self::STARTED;
  } else {
    $_SESSION['__HTTP_Session2_Info'] = self::CONTINUED;
  }
}

I can’t understand what is the cause of time delay. Probably, there are wrong Apache settings on the server. Or, maybe, there are some ‘locks’ on files with session information.

Maybe, someone has already encountered such problems and can help to solve it.

  • 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-13T05:58:36+00:00Added an answer on May 13, 2026 at 5:58 am

    The file containing the session’s informations is locked during the time PHP serves a request.

    So, if you have one PHP script (using a session) that’s currently being executed, and the same user sends another request, the second request will wait until the first is finished.

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

Sidebar

Ask A Question

Stats

  • Questions 254k
  • Answers 254k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I would probably use the -file argument, as in -file… May 13, 2026 at 10:10 am
  • Editorial Team
    Editorial Team added an answer That is because of the asynchronous nature of the AJAX… May 13, 2026 at 10:10 am
  • Editorial Team
    Editorial Team added an answer OK, I have found my own answer to this one… May 13, 2026 at 10:10 am

Related Questions

I have a problem using the Java search function in Eclipse on a particular
I have a problem with a little .Net web application which uses the Amazon
I have a problem in my project with the .designer which as everyone know
I have a problem that confuses my users, being that although an item is
I have a problem with a ClickOnce deployment of a Windows Forms application. When

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.