Friday, March 16, 2012

Login problems

I am integrating a shopping cart into my site, commerce starter kit, and I have gotten both to read from the same SQL Server with the same application name and I can login on the cart site with the same username and password that I use for my site. My problem is that if I log in to my site, then go to the cart, the cart doesn't recognize me as being logged in. I keep the cart in a sub folder and they both use seperate web.config files. Is there a way to carry it from one place to the other (I don't mean they are on seperate servers by that, they are on the same server). I am new to all of this so I am not even sure where to look to get this to work.

Thank you for your help.To kick off the replies my best guess would be to look at authentication cookies. See if there's some way to have the same cookie used for both sites.
I think this is the cookie part, so I am trying it in both web.config files so that the cookies will have the same name. When I try it though I get an error for the path part. I have looked in the help file, and online a bit, but haven't found a difinitive answer for what the path is for.

<authentication mode="Forms"/>
<forms name=".PEPWEB1" loginUrl="login.aspx" protection="All" timeout="30" path="/"/>
<authorization>
<allow users="?"/>
</authorization>

Thank you for your help.
I misunderstood the error. The problem was that I closed the authentication tag before setting the forms. I fixed it, but it still doesn't carry over the information.

Here is the section for my main directory web.config file
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<appSettings/>
<connectionStrings>
<add name="PEPSqlServer" connectionString="Removed" />
</connectionStrings>
<system.web>
<roleManager enabled="true">
<providers>
<clear/>
<add name="AspNetSqlRoleProvider"
connectionStringName="LocalSqlServer"
applicationName="PEPWEB1"
type="System.Web.Security.SqlRoleProvider"/>
</providers>
</roleManager>
<membership defaultProvider="AspNetSqlMembershipProvider"
userIsOnlineTimeWindow="15"
hashAlgorithmType="">
<providers>
<clear/>
<add connectionStringName="PEPSqlServer"
enablePasswordRetrieval="false"
enablePasswordReset="true"
requiresQuestionAndAnswer="true"
applicationName="PEPWEB1"
requiresUniqueEmail="True"
passwordFormat="Hashed"
maxInvalidPasswordAttempts="5"
passwordAttemptWindow="10"
passwordStrengthRegularExpression=""
minRequiredPasswordLength="6"
minRequiredNonalphanumericCharacters="0"
name="AspNetSqlMembershipProvider"
type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
</providers>
</membership>

This is from the cart web.config file
<roleManager enabled="true">
<providers>
<clear/>
<add name="AspNetSqlRoleProvider"
connectionStringName="LocalSqlServer"
applicationName="PEPWEB1"
type="System.Web.Security.SqlRoleProvider"/>
</providers>
</roleManager>
<membership defaultProvider="AspNetSqlMembershipProvider" userIsOnlineTimeWindow="15" hashAlgorithmType="">
<providers>
<clear/>
<add connectionStringName="LocalSqlServer"
enablePasswordRetrieval="false"
enablePasswordReset="true"
requiresQuestionAndAnswer="true"
applicationName="PEPWEB1"
requiresUniqueEmail="True"
passwordFormat="Hashed"
maxInvalidPasswordAttempts="5"
passwordAttemptWindow="10"
passwordStrengthRegularExpression=""
minRequiredPasswordLength="6"
minRequiredNonalphanumericCharacters="0"
name="AspNetSqlMembershipProvider"
type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
</providers>
</membership>
<anonymousIdentification enabled="true"/>
<authentication mode="Forms">
<forms name=".PEPWEB1" loginUrl="login.aspx" protection="All" timeout="30" path="/"/>
</authentication>
<authorization>
<allow users="?"/>
</authorization>

Thank you for your help.
I didn't add this, and it won't let me edit that post now. This is in the main root web.config file

<authentication mode="Forms">
<forms name=".PEPWEB1"
loginUrl="login.aspx"
requireSSL="false"
protection="All"
timeout="30"
path="/"/>
</authentication>
<authorization>
<allow users="?"/>
</authorization>
Can someone else help this guy? I don't really know much about this.

0 comments:

Post a Comment