share session through socket?
<p>friends,</p>

<p>We have an application developed by others in C#/ASP.NET. We now would like to do some modification. Here is the problem.</p>

<p>There are Host application and Client application, which are connected by socket. Each side will load a webpage by using. The webpage loaded by both sides are the same.</p>

<pre><code>private System.Windows.Forms.WebBrowser webBrowser1;
</code></pre>

<p>The socket is connected by:</p>

<pre><code>string portStr = "3232";
int port = System.Convert.ToInt32(portStr);
// Create the listening socket...
m_mainSocket = new Socket(AddressFamily.InterNetwork,
                          SocketType.Stream,
                          ProtocolType.Tcp);
IPEndPoint ipLocal = new IPEndPoint(IPAddress.Any, port);
// Bind to local IP Address...
m_mainSocket.Bind(ipLocal);
// Start listening...
m_mainSocket.Listen(4);
// Create the call back for any client connections...
m_mainSocket.BeginAccept(new AsyncCallback(OnClientConnect), null);
</code></pre>

<p>On some webpage, we would like to show images in different orders for two sides. So we propose to add a value to the Session of website.</p>

<p>So the url loaded is like: ('order' value is different for Host and Client)</p>

<pre><code>http://127.0.0.1/home.aspx?order=1_2_3
</code></pre>

<p>The home.aspx.cs page source is like:</p>

<pre><code>protected void Page_Load(object sender, EventArgs e)
{
    AjaxPro.Utility.RegisterTypeForAjax(typeof(home));
    if (Request.QueryString["random"] != null)
    {
        String order = Request.QueryString["random"].ToString();
        Session["order"] = order;
    }
}
</code></pre>

<p>We expect that the Client and Host will maintain different session, so they would have different 'order' values in session.</p>

<p>But the fact is, they are keeping ONE session! But for one of our another program, this approach works. So I am wondering maybe because somewhere the socket connection can specify some parameters, something like "share session or not". Could anybody please help us explain the reason or give some pointers? </p>

<p>Any help is appreciated. Thanks.</p>
