Hi nedash,
Here i have the sample thats working properly.
SecondSite
Default.aspx
<asp:LinkButton ID="LinkButton1" Text="Second Default" runat="server" OnClick="LBback_Click" />
Default.aspx.cs
protected void LBback_Click(object sender, EventArgs e)
{
Session["UserData"] = "test";
Response.Redirect("show.aspx");
}
show.aspx
<asp:Button Text="Session Out" runat="server" OnClick="Out" />
show.aspx.cs
protected void Page_Load(object sender, EventArgs e)
{
if (Session["UserData"] != null)
{
Response.Write("Session retrived successfully.");
}
}
protected void Out(object sender, EventArgs e)
{
Session["UserData"] = null;
Session.Abandon();
Session.Clear();
Session.Remove("UserData");
Response.Redirect("Default.aspx");
}
FirstSite
verify.aspx
<asp:LinkButton Text="First Default" runat="server" OnClick="LBback_Click" />
verify.aspx.cs
protected void LBback_Click(object sender, EventArgs e)
{
Response.Redirect("http://localhost:27722/190343_Secondsite/show.aspx");
}
Screenshot