
332
|
Chapter 16: The HttpRequest Class
This is the Title of the Book, eMatter Edition
Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved.
Notes
In addition to the IsAuthenticated property that the HttpRequest class exposes, the
FormsIdentity, WindowsIdentity, and
PassportIdentity classes expose an IsAu-
thenticated property for much the same purpose as the
HttpRequest class. Note
that the IsAuthenticated property of the
HttpRequest class returns the authentica-
tion status of the user regardless of the authentication method used.
IsSecureConnection
boolvar = Request.IsSecureConnection
Returns a Boolean indicating whether the current connection uses secure sockets
(SSL) for communication.
Parameter
boolvar
A Boolean variable to receive the SSL status of the current request.
Example
The example shows how you can take different actions depending on whether or
not the current request was made via SSL:
Sub Page_Load( )
Dim boolvar As Boolean
boolvar = Request.IsSecureConnection
If boolvar = True Then
Message.Text = "Connection is HTTPS."
Else
Message.Text = "Connection is HTTP."
End If
End Sub
Notes
You would typically use this property to determine whether or not to fulfill a
request that requires an SSL connection in order to encrypt sensitive data (such as
credit card numbers) that might be submitted via the requested page. Addition-
ally, you could use this property on a page that may or may ...