Sessions & SSL
From: John Hamilton via .NET 247 (anonymous_at_dotnet247.com)
Date: 04/23/04
- Next message: Jamie Sutherland: "Please Help - Encryption Problems"
- Previous message: Ed Staffin: "Forms Auth Problems."
- Next in thread: Paul Glavich [MVP - ASP.NET]: "Re: Sessions & SSL"
- Reply: Paul Glavich [MVP - ASP.NET]: "Re: Sessions & SSL"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Fri, 23 Apr 2004 05:13:07 -0700
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 www.abcdef.com, 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 (http://www.dotnet247.com/)
<Id>TrxuVMqXXUiPwAxTLCEbCw==</Id>
- Next message: Jamie Sutherland: "Please Help - Encryption Problems"
- Previous message: Ed Staffin: "Forms Auth Problems."
- Next in thread: Paul Glavich [MVP - ASP.NET]: "Re: Sessions & SSL"
- Reply: Paul Glavich [MVP - ASP.NET]: "Re: Sessions & SSL"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|
|