seesion cookie question.

A

ashish

We are having a web application which spans across multiple domains.
Iam trying to synchronize session information between the two domains.
If I know the value of ASP.NET_SessionId cookie, can I use a
HttpWebRequest class to send a request to the other domain with the
ASP.NET_SessionId cookie in it, and make ASP.Net think that this is the
same session Request ? ( i would be passing other credentials to secure it )

This is what i tried ( this is not working though !)

Dim myRequest As HttpWebRequest =
HttpWebRequest.Create("http://localhost/MyOtherSite/synchronize.aspx")


Dim mySessionCookie As New Cookie("ASP.NET_SessionId",
"fbo0sd55risyn245gfgunt45", "/")

mySessionCookie.Domain = "http://localhost/MyOtherSite/"

myRequest.CookieContainer = New CookieContainer

myRequest.CookieContainer.Add(mySessionCookie)

Dim myResponse As HttpWebResponse = myRequest.GetResponse

Dim myStream As IO.Stream = myResponse.GetResponseStream

Catch ex As Net.WebException
MessageBox.Show(ex.ToString)
End Try


any help or pointers would be appreciated

thanks
-ashish
 
G

Guest

If I understand you correctly you may just need to share the cookie. If both
of your sites are on the same domain you can share a cookie between machines
by explicitly setting the cookie.domain = <.mydomain.com>.

Hope this helps.
 
A

ashish

Hi ENIZIN ,
thanks for the response

what i would really like to do is to send a request to the other domain
using HTTPWebRequest class, and i want the other domain to associate
this request with the session i want it to ..

this way i would be able to control session variables on the other
domain without explicity redirecting user to it.

regards
-ashish
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top