Re: session Objects




"Roedy Green" <my_email_is_posted_on_my_website@xxxxxxxxxxxxxx> wrote in
message news:bmplu1t7j0h8m9328i7h5ps79uaqcpj5nl@xxxxxxxxxx
On Wed, 8 Feb 2006 14:58:28 -0600, L. Beaux Al-Catraz III
<silverbells@xxxxxxxxxxxxxx> wrote, quoted or indirectly quoted
someone who said :


When a browser hits your site, session starts.

When the browser leaves, session ends.

The browser won't tell the server though about its leaving, right?

you just have to time out.

I don't know about JSP, but in the PHP world, the page is only sent to
the browser once the code has finished executing. So timing-out in the
traditional sense is not even an option, as by the time the user *STARTS*
downloading the HTML, the script has already finished executing.

What is usually done in PHP is to check on the *next* request whether
there's any left-over work to be done from the previous request. Note that
this "next request" might not be from the same client as the one that made
the previous request.

Garbage collection for session files, for example, is usually randomly
done 1 out of 10 times at the beginning of every request. So on average,
after every 10 requests made, the PHP engine will search the session
directory and delete all the session files older than, say, 20 minutes, for
ALL users; not just the user who made the request that invoked the PHP
engine in the first place.

- Oliver


.



Relevant Pages

  • Re: Looking for general advice on security
    ... PHP pages have to be world-readable, ... SSL provides a way for a thief with a browser to communicate with ... cookies because the user can't fake a session with arbitrary contents, ... Try to send a message to the user and see if the mail server ...
    (comp.lang.php)
  • Re: What is URL rewriting?
    ... URL rewriting is the option when the client browser doesn't accept ... browser doesn't accept cookies. ... user information is usually stored as session object. ... so that the user agent can send that ID back on its next request. ...
    (comp.lang.java.programmer)
  • Re: session hang problem
    ... PHP 5.x.x you don't need to. ... store variables and objects inside session variables, ... every request from the site domain 'hangs up' from this ... Did you try asking your hosting provider? ...
    (comp.lang.php)
  • Re: setting session timeout through .htaccess
    ... >In all of my sessions work with PHP the ... >session identifier cookie is set automatically by PHP with an expiry ... >time of the life of the browser... ... their cookie is alive... ...
    (comp.lang.php)
  • Re: Free PHP 1 to 1 chat program
    ... >> PHP can only send a response back to the web browser in answer to a ... >> from the browser. ... This is not a limitation of PHP, ... environment on each request. ...
    (comp.lang.php)