YAFLogo

Ernie Curto
  • Ernie Curto
  • 50.6% (Neutral)
  • YAF Forumling Topic Starter
16 years ago
I am trying to integrate YAF into my web site. I cannot get the login to synchronize between the site and YAF. I can log into the site, but YAF does not show the person logged in when I go to the forum page. When I log into YAF from the forum page, I get logged into the forum, but I get logged out of my site. From the debugger for the login button, I can see that the userID is correctly obtained from the YAF database.

I am using .net for the site. In my visual studio code I have a folder called yaf that holds the install for the forum. For my site I am using the .net authentication. In the sites root directory I have the web.config and yafnet.config files. Below are the code for these files and the login for my site.

Does anyone know what the problem is for the dual login.

Thanks.

Web.config file

providerName="System.Data.SqlClient" />

decryptionKey="AutoGenerate,IsolateApps"

validation="AES"

decryption="Auto" />

yafnet.config file

pug/yaf

user id=pug??;pwd=??????;data source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\ASPNETDB.MDF;Integrated Security=True;User Instance=True;timeout=20

~/pug/upload/

1

false

C# code for the login button on the site login page

protected void LoginButton_Click(object sender, EventArgs e)

{

string sPassword = FormsAuthentication.HashPasswordForStoringInConfigFile(Login1.Password, "md5");

object userID = yaf.DB.user_login(1, Login1.UserName, sPassword);

if (userID != DBNull.Value)

{

string idName = userID.ToString();

if (Request.QueryString["ReturnUrl"] != null)

{

FormsAuthentication.RedirectFromLoginPage(idName, false);

}

else

{

FormsAuthentication.SetAuthCookie(idName, false);

yaf.Forum.Redirect(yaf.Pages.forum);

}

}

}

Sponsor