Login Parent logs out BlogEngine and Vice Versa

Dec 16, 2010 at 6:07 AM

I have a parent application at http://site/  running iis7.  I have a virtual app set at http://site/blogs.  when the user of the parent / directory logs in, it auto-logs out the /blogs blogengine and if they log into blogengine it logs them out of /.

I have set up the web config to virtually match between the two.  I have made sure applicationName="MySite" everywhere possible.  


<forms timeout="129600"
    <machineKey validationKey="AutoGenerate,IsolateApps"
                validation="SHA1" decryption="Auto" />


I am using SQL and the asp.net Membership and roles.  If I log into blogengine it works fine.  If i log into my site, it works fine.   However, If i log into my site and then blog engine I am logged out of my site.   If I log into blog engine and then my site, I am logged out of blogengine.

Any suggestions?  Thanks for any help.

Dec 16, 2010 at 6:30 AM

So, after some research, even though everything is Identical, a loop of the cookies results in .MYSITE being used by my site and .MYSITEROLES being used by the blogengine site.

I would then venture to guess that my site uses or utilizes the membership login process wrong.  any suggestions on how to mimic the blogengine process?  I'm stepping through blogengine's source now.. some direction would be appreciated.

Dec 16, 2010 at 7:13 AM

If you're trying to get the logins on both applications so they "match" where when you are logged into one site, you are logged into the other site at the same time, the one thing that looks missing is defining the same Machine Key in both web.config files.  In the configuration you posted, it shows AutoGenerate, but you would instead want to specify a machine key.

You can use this site to generate a machine key.  It will provide you the entire <machineKey> tag.  You would want to use the same <machineKey> tag it creates in both sites.

Dec 16, 2010 at 7:17 AM
Edited Dec 16, 2010 at 7:29 AM

That was exactly it. Thank you.

Jan 2, 2011 at 10:01 AM

Hi Ben I have Silverlight 4 app and BE as sub app, when user is created in Sl 4 app new blog is created as sub app for that user. I unified login cookies, use BE web.config file for asp.net 4 and everything is working fine, but have the following issue:

 When logged in user opens another user blog, the blog is empty, but when anonimous user opens someones blog then the blog opens fine.

-In BE i set forms auth to share SL 4 app auth; membership and profile providers are the same as parent sl4 app and role provider is the default xml provider (in users.xml and roles.xml i programmatically add user name and role upon registration)

Any advise how to workaround this small issue?

 I guess BE detects that user is logged but not finding it in users.xml causes some permission issue and shows empty blog. I would like when logged in user opens other user blog to act for BE as anonimous user and show that particular blog.

Sorry for my english, thanks in advance. Great blogging app!