NetTalk Central

Author Topic: WebHandler - New Session Embed - Firing Multiple Times  (Read 3888 times)

David

  • Full Member
  • ***
  • Posts: 127
    • View Profile
WebHandler - New Session Embed - Firing Multiple Times
« on: December 11, 2008, 12:44:04 PM »
I have a message sent to debugview in the new session embed.  When I browse to my site, I will get anywhere from 4 to 10 messages as the page loads.  I would think that this would only run once per new connection.  Once that first page is loaded, then I don't get another message until I logout of the site or another use tries to connect.

Does anyone know if this is normal behavior or due I have an issue.

PS. It is only me on the dev machine hitting the web server.

NT 4.31 PR22

Mike Grigsby

  • Sr. Member
  • ****
  • Posts: 380
    • Yahoo Instant Messenger - onthedotsoftware
    • View Profile
    • MyHomeAssets! Software (among others)
Re: WebHandler - New Session Embed - Firing Multiple Times
« Reply #1 on: December 11, 2008, 02:04:02 PM »
That's pretty normal, if you mean the error messages. If you look at the page source, there's all kinds of non standard stuff going on, like multiple page headers and stuff.
Mike Grigsby
Credify Systems
Central Oregon, USA

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: WebHandler - New Session Embed - Firing Multiple Times
« Reply #2 on: December 14, 2008, 10:40:26 PM »
Hi David,

This is fairly normal, and happens because of the way browsers work.

What's happening is this;

a) when the browser asks for the first page then the page is sent from the server to the browser. At this time the server sends the browser a "cookie" which contains the session ID, which the browser then uses for all future requests.

b) That's cool and all, but hides a small problem. The problem is that stuff embedded on the first page (CSS files, JS files, Images and so on) are fetched with a _separate_ call to the server. And they are often (especially for CSS and JS) fetched _before_ the original page is complete. So at this point (on some browsers) the new cookie has not "kicked in" yet. So these "simultaneous" requests are passed without a cookie, hence triggering the "new session".

Cheers
Bruce