I have two web applications hosted on a server using virtual directories created on IIS.
like : 123.12.23.124/site1 , 123.12.23.124/site2
Now i need to access the session created in site1 in site2. This is what i have done so far:
- change both site's web.config files to use stateserver session as
sessionState mode="StateServer" cookieless="false" timeout="720" stateConnectionString="tcpip=127.0.0.1:42424"
- I went into services and started asp.net state service on the server.
I have set up session as on site1:
session["user"] = "xxxx";
And accessing in site2 as :
if(session["user"] != null)
{
}
else
{
//Always coming here
}