Web session timeout?

Post your HTML code (as attachments) here and a description of what that scene does.
User avatar
bhiga
Expert
Expert
Posts: 854
Joined: Tue Mar 08, 2005 10:28 pm
Location: San Jose, CA
Contact:

Web session timeout?

Postby bhiga » Thu Nov 15, 2007 3:33 pm

I was wondering what the default web session timeout is, and if that can be changed? Maybe there's a better way to do this, neither my javascript nor my PHP is what it used to be...

Here's the situation...
I'm trying to adapt the WebDemo example to be accessible from the "outside world" - but of course I don't want to put my MLServer machine on the public Internet.

So, I set up a PHP script on my regular webserver that acts as sort of a proxy to my MLServer machine. Essentially the PHP script accepts the command from the browser, makes the corresponding HTTP GET to my MLServer machine, and passes the data back.

I know the PHP script is working because I can make arbitrary requests to it and I get the XML just like the WebDemo JavaScript should be getting.

However, I noticed that MLServer is counting each request as an individual web session, so I run out of web sessions quite quickly. Luckily they seem to time out and die, but it's making my testing a bit difficult since I have to wait between test rounds.

Maybe I'm doing something wrong in the PHP side and should somehow be establishing a persistent session from the MLServer web server, but I'm still learning the PHP HTTP request side of things...

Here's what my PHP code looks like right now:

Code: Select all

<?php
  $chrURL = 'http://ip.address.of.my.MLServer.machine/' . $_SERVER['QUERY_STRING'];

  foreach (get_headers($chrURL) as $chrHeader) {
    header($chrHeader);
  }

  echo "\n\r"; // my webserver complains if there's no blank line between headers and content

  echo file_get_contents($chrURL);
?>


So, a request to http://my.public.web.server/Redirect.ph ... movietitle
correctly returns the XML with the currently selected movie's title.

I'm pretty sure get_headers is taking one MLServer web session and file_get_contents is taking another separate MLServer web session, so every request "eats" 2 sessions already, which is why I'm burning through sessions like mad even though they're all originating from the same IP address.

Maybe someone's a PHP guru here?

Side note: I'm running Visnetic Website 3.5.19 with PHP 5.2.3 in CGI mode (I can't seem to get ISAPI mode to work - keep getting "No input file specified" and tried a number of Googled fixes to no avail.)

Thanks for help and suggestions!
Brandon
- Brandon
My MainLobby stuff (plug-ins, screenshots, etc)

User avatar
bhiga
Expert
Expert
Posts: 854
Joined: Tue Mar 08, 2005 10:28 pm
Location: San Jose, CA
Contact:

Postby bhiga » Fri Nov 30, 2007 10:36 am

After learning a lot about PHP sessions (and the fact that they seem to need PHP to run ISAPI and not CGI), cookies, HTTP requests and response headers, I got things working.

Still have a few things to clean up, but the project is coming along nicely.

The HTML interface is quite powerful and a very useful feature for remote and/or underpowered clients if you're willing to put the time/effort into developing it.

Brandon
- Brandon

My MainLobby stuff (plug-ins, screenshots, etc)


Return to “MLServer HTML Sharing”

Who is online

Users browsing this forum: No registered users and 1 guest