-----------------------------------------------------------
New Message on BDOTNET
-----------------------------------------------------------
From: Absent_Minded_Aquarian
Message 3 in Discussion
Hi! You got to do a RedirectFromLoginPage since that method, internally, does all
the work to set the state as authenticated. Aan uthentication cookie is created based
upon the username and date, as shown below: FormsAuthenticationTicket local0;
string local1;
HttpCookie local2;
DateTime local3; FormsAuthentication.Initialize();
if (userName == null)
userName = "";
if (strCookiePath == null || strCookiePath.Length < 1)
strCookiePath = FormsAuthentication.FormsCookiePath;
if (!(createPersistentCookie)) {
local3 = DateTime.Now;
goto i-1;
}
local3 = DateTime.Now;
local0 = new FormsAuthenticationTicket(userName, DateTime.Now,
local3.AddMinutes((double) FormsAuthentication._Timeout), local3.AddYears(50),
createPersistentCookie, "", strCookiePath);
local1 = FormsAuthentication.Encrypt(local0);
FormsAuthentication.Trace("ticket is " + local1);
if (local1 == null || local1.Length < 1)
throw new
HttpException(HttpRuntime.FormatResourceString("Unable_to_encrypt_cookie_ticket"));
local2 = new HttpCookie(FormsAuthentication.FormsCookieName, local1);
local2.Path = strCookiePath;
if (local0.IsPersistent)
local2.Expires = local0.Expiration;
return local2; You got to do all this, in addition to creating an authentication
ticket, if you dont wish to use the RedirectFromLoginPage method. Why take the pain,
when its being done for you by the system? Gaurav ---------- Microsoft MVP - .NET
WinToolZone - Spelunking Microsoft Technologies http://www.wintoolzone.com/ OpSupport
- Spelunking Rotor http://opsupport.sscli.net/
-----------------------------------------------------------
To stop getting this e-mail, or change how often it arrives, go to your E-mail
Settings.
http://groups.msn.com/bdotnet/_emailsettings.msnw
Need help? If you've forgotten your password, please go to Passport Member Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help
For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact
If you do not want to receive future e-mail from this MSN group, or if you received
this message by mistake, please click the "Remove" link below. On the pre-addressed
e-mail message that opens, simply click "Send". Your e-mail address will be deleted
from this group's mailing list.
mailto:[EMAIL PROTECTED]