tags:

views:

44

answers:

3

Hi all,

How we transfer my session from http page to https page.

Thanks

A: 

One way to do this: Put identifying cookie on user's pc or identifying string in address, close session, redirect to https, from there get identity information from the cookie or the address and open a new session...

Martin
+1  A: 

Try this

protected override void OnInit(EventArgs e)
{
    if (!Request.IsSecureConnection)
    {
        Response.Redirect(Request.Url.AbsoluteUri.ToLower().Replace("http://", "https://"), true);
    }
}

On page load

   bool test = Request.IsSecureConnection;
    if (!test)
    {
        Uri strQueryString = HttpContext.Current.Request.Url;
        UriBuilder builder = new UriBuilder(strQueryString);
        builder.Scheme = Uri.UriSchemeHttps;
        builder.Port = 443;
        Server.Transfer(builder.Uri.ToString());
    }
Dorababu
A: 

Send session values as part of an HTTP GET or POST request from the HTTP URL to the HTTPS URL.

Bala