Author: Demo1 | Posted on: 6/5/2009 4:04:43 AM | Views : 721

 Hello,
 I got strange problem on live website that build using ASP.NET 2.0, on that website in some pages only when visit e.g. /login.aspx, /myaccount.aspx and similar must be as HTTPS with secure cookies.

  So if visitor or user is visited to http://website/login.aspx then check for http:// and if requare redirect to https:// page. Code below:

1 Dim sUrl As String = Context.Request.Url.ToString.Trim
2 Dim iPos As Integer = sUrl.IndexOf("http://")
3 If iPos = 0 Then
4 Context.Request.Cookies("ASP.NET_SessionID").Secure = True
5 Conte ...

Go to the complete details ...