-----------------------------------------------------------

New Message on BDOTNET

-----------------------------------------------------------
From: vishnuvr
Message 1 in Discussion

Hi guys, i am using forms authentication in my application. And for testing purpuse i 
set this timeout  for one minute, the problem is if some authenticatedUser  left the 
some screen idle for more than one minute and afterwords if he click some thing in the 
form it is redirecting it to login page but in login page if i enter other valid user 
credentials then also it is taking that other user to the same  page which is not 
appropriate   login page looks some thing like this     
public void authenticateUser(string userName,string userPwd){ 
FormsAuthenticationTicket ticket =  
new FormsAuthenticationTicket(1,userName, DateTime.Now, DateTime.Now.AddMinutes(1.0),  
true, "Custom Data",FormsAuthentication.FormsCookiePath); 
string cookieval = FormsAuthentication.Encrypt(ticket); 
 
HttpCookie cookie = new HttpCookie(FormsAuthentication.FormsCookieName,cookieval); 
Response.Cookies.Add(cookie); 
string returnUrl = Request.QueryString["ReturnUrl"]; 
if (returnUrl == null) returnUrl = "/"; 
Response.Redirect(FormsAuthentication.GetRedirectUrl(userName, true)); 
} 
as in gloabl.asax i implemented like this... 
protected void Application_AuthenticateRequest(Object sender, EventArgs e) 
{ 
if (HttpContext.Current.User != null) 
{ 
if (HttpContext.Current.User.Identity.IsAuthenticated) 
{ 
if (HttpContext.Current.User.Identity is FormsIdentity) 
{ 
FormsIdentity id = (FormsIdentity)HttpContext.Current.User.Identity; 
FormsAuthenticationTicket ticket = id.Ticket; 
// Get the stored user-data, in this case, our roles 
string userData = ticket.UserData; 
string[] roles = userData.Split(','); 
HttpContext.Current.User = new GenericPrincipal(id, roles); 
} 
} 
} 
can any body tell how to solve this.. 
  
  
 

-----------------------------------------------------------

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]

Reply via email to