Forum Moderators: open

Message Too Old, No Replies

Session variable between 2 servers

how can I send send info from 1 server to another

         

smitko

11:31 am on Feb 12, 2004 (gmt 0)

10+ Year Member



You can use a session variable to pass info between two page. How will you do it if it is between 2 different ASP servers and you do not want to pass a query string or cookie?/ or can you hide the query string?

mattur

11:31 am on Feb 13, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Session variables use a cookie with a unique id to store information for a particular browser session.

I'm not sure exactly what you are trying to do, but to pass info around you will have to use a cookie or a querystring (or a form post).

If the servers are both on the same domain e.g. www.mydomain.com and secure.mydomain.com you can set cookie values with the domain set as "mydomain.com" and access them from either server.

If the servers have different domains, I think you would have to at least pass an id in the querystring. HTH.

smitko

11:59 am on Feb 13, 2004 (gmt 0)

10+ Year Member



Hi, I am an a LAN (INTRANET) and have two IIS servers. When I use a session variable on server 1 I do not see the Sesson variable on server 2?

Jimmy Turnip

12:17 pm on Feb 13, 2004 (gmt 0)

10+ Year Member



If you are using a cluster server and one site, I got around it by adjusting the settings on the server so that when a page is first requested it uses the least busy server and then continues to use that server for the duration of the session instead of requesting the page from the least busy server again (which could be different to the original).

mattur

1:21 pm on Feb 13, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



When I use a session variable on server 1 I do not see the Sesson variable on server 2?

That's how ASP sessions work. When a session begins the web server sets a unique id cookie in the browser. When you then store a session variable it is held on that server in memory, keyed with that unique id.

When you go to a different server the session variable isn't available because it isn't in the browser, it's in the memory of the original server.

So to pass information between different servers you have to either use domain-level cookies or querystring variables.

If you explain what you need to pass between servers we may be able to give you more specific tips. HTH.

TheNige

12:32 am on Feb 14, 2004 (gmt 0)

10+ Year Member



if you use ASP.Net the Session objects can be stored on a SQL server, so no matter which web server you hit in the farm the Session would be the same.

smitko

6:37 am on Feb 16, 2004 (gmt 0)

10+ Year Member



Hi, I need to pass USERID's and that will not work to use a query string, as people will change the string.I Used a cookie, but onlyu want to know if there is a nother method