DekGenius.com
[ Team LiB ] Previous Section Next Section

MobileFormsAuthentication.NET 1.1

System.Web.Mobile (system.web.mobile.dll)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.FormsAuthentication 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 information. 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.FormsAuthentication.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 {
// Public Static Methods
   public static void RedirectFromLoginPage(string userName, bool createPersistentCookie);
   public static void RedirectFromLoginPage(string userName, bool createPersistentCookie, string strCookiePath);
   public static void SignOut( );
}
    [ Team LiB ] Previous Section Next Section