views:

350

answers:

4

Ok I have done enough research on it but cant find the solution. Its from one page of a application to another page of application. Since I would be sending in username and password i cant send it as "getT" so i need to do a "post". I will be using ssl though - not sure if that helps.. so i cant use sessions as its on different apps and using those shared sessions like databsae is performance killing Also once the user clicks the link on the source page, i need to do some post processing and then want to post to the other page so using the form and stuff wont work..

any help

fyi: What I am trying to achieve is that a person when logs in app A, they click some link, i dont some processing and want to transfer them to app B where they dont have to relogin in app B but instead automatically get logged in..

+1  A: 

Maybe not the best solution, but you could use a cookie.

kscott
Assuming these are virtual applications under the same root, then do this but verify that the cookie path references the outer application. Otherwise you won't be able to share them.
Chris Lively
+2  A: 

We use Global.asax to do much the same thing you are describing. Assuming both web apps use the same business domain. You can use the following to set a logged in user in our business domain. You can then use the presence of that property to know not to ask for login again on your second Web App.

    /// <summary>
    ///     Event fires when an HTTP request is made to the application.
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void Application_PreRequestHandlerExecute(object sender, EventArgs e)
    {
        // If we don't have a logged in user.
        if (<BusinessDomain>.Constants.LoggedInUserID == null)
        {
            // Ensure that Context.Handler for this particular HTTP request implements an interface that uses a Session State.
            if (Context.Handler is IRequiresSessionState || Context.Handler is IReadOnlySessionState)
            {
                if (Session != null)
                {
                    // Set the currently logged in user in our Business Domain.
                    if ((Guid)Session["UserID"] != Guid.Empty)
                    {
                        <BusinessDomain>.Constants.LoggedInUserID = Session["UserID"];
                    }
                }
            }
        }
    }
Matthew Vines
A: 

I think you're looking for a Single Site Login solution.

Tomas Lycken
A: 

Agree with Thomas, sounds tailor made for the single sign on solution. Multiple web apps using a single sign on, so once you log in on one app you logged in on all that reference the membership provider..

http://weblogs.asp.net/scottgu/archive/2006/05/07/ASP.NET-2.0-Membership-and-Roles-Tutorial-Series.aspx

http://dotnetslackers.com/ASP_NET/re-29031_ASP_NET_2_0_Implementing_Single_Sign_On_SSO_with_Membership_API.aspx

hope that helps

Stuart