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

New Message on BDOTNET

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

I have an application where in iam using forms authentication mode, in web.config i 
have set some thing like this for it. <authentication mode="Forms" ><forms 
name="_MyAuthCookie" loginUrl="Login.aspx?msg=session time out, Plz relogin " 
timeout="5" path="/" /></authentication> and in my global.asax file i set this 
function 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; 
 string userData = ticket.UserData; 
 string[] roles = userData.Split(','); 
 HttpContext.Current.User = new GenericPrincipal(id, roles); } } } 
initially it was working fine...After some time when i click login button in login 
screen it was giving an error-->Redirection limit for this url exceeded.unable to load 
the requested page.This may be caused cookies that are blocked in netscape browser, 
but in IE 6.0 the page is not at all moving further... this is wat the code for login 
click button in login page is  
FormsAuthenticationTicket ticket =  
new FormsAuthenticationTicket( 
1,  
userName,  
DateTime.Now,  
DateTime.Now.AddMinutes(5.0),  
false,  
"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)); 
Response.Redirect("default.aspx"); 
Iam not able to move further in my application due to this.. i tried this by clearing 
all the cookies in my exporer nothing is worked out.. but the same code is working 
fine in other PC is there any stting i have to modify or is it due to some code 
problem.. can any body help me in this.. 
10x in advance 
vishnu 
  
 

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

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