
536
|
Chapter 28: The System.Web.Mobile Namespace
This is the Title of the Book, eMatter Edition
Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved.
MobileFormsAuthentication
System.Web.Mobile (system.web.mobile.dll)
.NET 1.1
class
This helper class supports cookieless ASP.NET forms authentication. When using
forms authentication with a mobile device, you can still use the System.Web.Security.Forms-
Authentication helper class. However, if your mobile device does not support cookies, you
can use the alternate RedirectFromLoginPage( ) and SignOut( ) methods.
The RedirectFromLoginPage( ) method adds encrypted authentication information to the
query string, instead of creating a cookie. The SignOut( ) method removes this informa-
tion. These are the only two methods provided by the MobileFormsAuthentication class. If
you need other forms authentication functionality, you can use the shared members of
the System.Web.Security.FormsAuthentication. For example, you might use System.Web.Security.Forms-
Authentication.Authenticate( ) to validate user-supplied credentials against values in a
configuration file.
Remember, information in the URL will be preserved if your application uses relative
URL redirects. However, if the user types in a new URL, or you use an absolute URL
to redirect the user, any session and authentication information will be lost.
public class MobileFormsAuthentication {