Ask a Question related to ASP.NET Security, Design and Development.

  1. #1

    Default Sessions & SSL

    Hello. Here's my problem. I have an e-commerce site with alogin & checkout pages needing to be secure. To enforce thesepages to be ssl I simply put in the page load:

    If Not Request.IsSecureConnection Then
    Response.Redirect(Request.URL.AbsoluteUri.Replace( "http:","https:"))
    End If

    Now this works fine as long as cookieless is false. I'm finewith that. The only problem is IE gives a popup warning thatthe certificate name doesn't match the site. This is becausethe original page server_host is setup as [url]www.abcdef.com[/url], andthe common name on the ssl is only abcdef.com (no www).

    Now if I change my redirect code to this:
    If Not Request.IsSecureConnection Then
    Response.Redirect(Request.URL.AbsoluteUri.Replace( "http://" &Request.ServerVariables("HTTP_HOST"), "https://abcdef.com"))
    End If

    A new session is created because the server_host is different,and all information from the previous http session isunavailable in the new https session. I could force all pagesto use the common name as the host, but this is not ideal. Eventually I'd like to use a shared ssl server (on the samemachine). Is there any way around this without serializing allmy objects and storing them in cookies?

    Thanks!


    --------------------------------
    From: John Hamilton
    MCP, MCSD, MCDBA

    -----------------------
    Posted by a user from .NET 247 ([url]http://www.dotnet247.com/[/url])

    <Id>TrxuVMqXXUiPwAxTLCEbCw==</Id>
    John Hamilton via .NET 247 Guest

  2. Similar Questions and Discussions

    1. Sessions? Or another way?
      I am tasked with having a signon page for a section of a site. 1) User would need to enter their username/password 2) Be allowed to upload...
    2. CGI::Sessions : Deleting expired sessions
      Hi, I use CGI::Sessions to save the sessions into MySQL. The problem is, if the user just close the browser windows without logging off, I can't...
    3. Database sessions and file sessions
      Can database sessions and file system sessions co-exist on the same server. I have 2 applications that use sessions. One uses the standard php...
    4. Relationship between IIS Sessions and ASP.NET Sessions?
      Ken, I did some testing after I posted this message. I set my IE settings for cookies to Always Prompt (even session cookies) to see what was...
  3. #2

    Default Re: Sessions & SSL

    SSL works by using host affinity and there is not much way around this
    without perhaps having one site as a "subite" of the other. So one would be
    the main site, and the other might be a virtual directory that exists
    beneath the main site, thus enabling the subite to utilise the same
    certificate.


    HTH,
    --
    - Paul Glavich
    Microsoft MVP - ASP.NET


    "John Hamilton via .NET 247" <anonymous@dotnet247.com> wrote in message
    news:O#FgXxSKEHA.3436@tk2msftngp13.phx.gbl...
    Hello. Here's my problem. I have an e-commerce site with a login &
    checkout pages needing to be secure. To enforce these pages to be ssl I
    simply put in the page load:

    If Not Request.IsSecureConnection Then
    Response.Redirect(Request.URL.AbsoluteUri.Replace( "http:", "https:"))
    End If

    Now this works fine as long as cookieless is false. I'm fine with that.
    The only problem is IE gives a popup warning that the certificate name
    doesn't match the site. This is because the original page server_host is
    setup as [url]www.abcdef.com[/url], and the common name on the ssl is only abcdef.com
    (no www).

    Now if I change my redirect code to this:
    If Not Request.IsSecureConnection Then
    Response.Redirect(Request.URL.AbsoluteUri.Replace( "http://" &
    Request.ServerVariables("HTTP_HOST"), "https://abcdef.com"))
    End If

    A new session is created because the server_host is different, and all
    information from the previous http session is unavailable in the new https
    session. I could force all pages to use the common name as the host, but
    this is not ideal. Eventually I'd like to use a shared ssl server (on the
    same machine). Is there any way around this without serializing all my
    objects and storing them in cookies?

    Thanks!


    --------------------------------
    From: John Hamilton
    MCP, MCSD, MCDBA

    -----------------------
    Posted by a user from .NET 247 ([url]http://www.dotnet247.com/[/url])

    <Id>TrxuVMqXXUiPwAxTLCEbCw==</Id>


    Paul Glavich [MVP - ASP.NET] Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139