in reply to Creating Socket Connections that are persistent across multiple page loads in a single web session

Is there some way I can use the same socket over multiple page requests which share a common session id?

There is only way and its very simple, after your program arranges with the remote server for a persistent connection, remain connected, don't disconnect, keep connection alive, and keep using it.

  • Comment on Re: Creating Socket Connections that are persistent across multiple page loads in a single web session

Replies are listed 'Best First'.
Re^2: Creating Socket Connections that are persistent across multiple page loads in a single web session
by unlinker (Monk) on Jan 05, 2011 at 09:31 UTC
    How do I pass the socket from one pass through the web page to the next?

      You don't. You keep the socket open in the server and give the client a session id (see CGI::Session) using which you can find the appropriate socket back in your server program.

        Thank you for being patient, but sorry, I dont get it (not my best day, obviously:)). Are you suggesting that I serialize the socket and store it as a session scalar and deserialize it back in the next pass of the same session? I doubt that you can do it with sockets.