Dear folks,
after looong time searching, trying and whining, I've found finally a solution to make multisite login easy:
The Problem:
You run
PostNuke multisite under different subdomains (like modules.postnuke.com, block.postnuke.com, etc.) and you want people to enable to log in once to gain access to all sites (in contrast to postnuke.com where users do need to login each time they switch between sites). So assuming you are sharing all necessary user- and session-tables, here's the solution:
As already proposed, the cookies are the problem. They need to carry a domain name like postnuke.com and NOT blocks.postnuke.com
Well, now I've tried this solution and it worked for me - I've found it at
http://noc.postnuke.…p?type=snippet&id=2:
The problem with the current default multi site setup on PostNuke is you have to log in at each site. Trying to duplicate what happens at http://www.postnuke.com I did the following. I shared my sessions table. This resulted in the Who's Online blocks recognising you were on all the sites but you weren't logged in. This wasn't good. The logged in state is "kept" in a cookie. I used the viewhtml script at the following URL to view the HEAD: http://www.rexswain.com/httpview.html The result was as followed: "Set-Cookie:·POSTNUKESID=2569a63ee8a11dc9475fa26b200bd559;·expires=Wed,·02-Feb-28·18:45:27·GMT;·path=/" Notice the lack of a domain name in the cookie. I would like that to be *.example.com. Searching the PostNuke files i found that the cookie is set in NS-User/tools.php on line 67 (cvs version) in the function docookie(). That line states setcookie("user","$info",time() + 15552000); Looking at the PHP manual i see that domain, path etc are optional and path is default the dir the cookie is set in. Reading further i see that sub domains can be set like this: "To make the cookie available on all subdomains of example.com then you'd set it to '.example.com'. The . is not required but makes it compatible with more browsers." So i changed line 67 to setcookie("user","$info",time() + 15552000,"/",".example.com")
So, thanks to roderik who've proposed this solution !!
Now I just have to figure out how to not-share tables...but this is a different issue :D
Mel