You are here: Re: session_start hangs parallel requests for the same session « PHP Programming Language « IT news, forums, messages
Re: session_start hangs parallel requests for the same session

Posted by Jerry Stuckle on 06/11/07 20:03

Sergei Shelukhin wrote:
> Hi. I have a session started in php and two browser windows (IE)/tabs
> (FF) open.
> In one window, I execute a very slow report, immediately after that, I
> execute a fast simple page in another.
>
> I have set up a timer that records time into global variable at the
> start of the request,
> it outputs three time values in seconds - right before session_start,
> right after session_start, and at the very end of the request.
> here's what it shows
> Slow report that started a second earlier:
> DEBUG: Before session start: 0.0115
> DEBUG: Session start: 0.0133
> DEBUG: End request: 101.9878
>
> "Quick" page that started after it:
> DEBUG: Before session start: 0.0114
> DEBUG: Session start time: 98.467
> DEBUG: End request: 99.084
>
> The same is true for any request count, all of them load as fast as
> the slowest one.
> What's wrong w/session_start and how do I fix it?
>

Sessions are single threaded. If you already have the page open in one
session, PHP will hold any other requests for that same session.

To resolve the problem you need to call session_write_close() in the
long-running task. Of course, after that you won't have access to any
of the $_SESSION variables.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация