Milancie 0 Newbie Poster

I am trying to implement forms authenication asp.net 2010 through a login page and database table of usernames and passwords

Some of the users some of the time must authenicate twice which is getting annoying to those users and they are complaining

In the web.config I have

<authentication mode="Forms">
<forms loginUrl="WebFormLogon.aspx" defaultUrl="WebformHomepage.aspx"/>
</authentication>

In the code behind file after validating the password and username I do the
following

FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(1,
username,
DateTime.Now,
DateTime.Now.AddMinutes(60),
isPersistent,
userData,
FormsAuthentication.FormsCookiePath);

// Encrypt the ticket.
string encTicket = FormsAuthentication.Encrypt(ticket);

// Create the cookie.
Response.Cookies.Add(new System.Web.HttpCookie(FormsAuthentication.FormsCookieName, encTicket));

string redirectpage = FormsAuthentication.GetRedirectUrl(username, isPersistent);
Response.Redirect(redirectpage);

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.