Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Multi-site and draft article preview
Finally got round to getting multi-site installations working. Noticed that this breaks the draft article preview function, because the txp_login_public
cookie does not cross subdomains. Just playing around I got it working again locally, and am considering submitting a patch. Questions:
I think all that needs to be done is to add the domain argument to the setcookie()
calls in doTxpValidate()
. Any reasons this is a bad idea? Or incomplete?
Was thinking a reasonable way to trigger this would be a preference setting, multi_site_domain
, perhaps. This would be empty/false by default; if set to true or the value of the domain the domain would be added to the public-side cookie. Better ideas?
Code is topiary
Offline
Re: Multi-site and draft article preview
Pursuant to this idea, I noticed something puzzling (to me, anyway) in txp_auth.php, lines 171–173 169–171 (r3250):
setcookie('txp_login', $c_userid, time()+3600*24*365);
setcookie('txp_login_public', '', time()-3600, $pub_path, $domain);
$message = gTxt('bad_cookie');
Cookie exists but is apparently crumbled, and the bad_cookie message (“Your login session has expired. Please login again.”) is displayed. The public-side cookie is set to an expired value, but the admin-side cookie is refreshed. I’m thinking this is not the intent?
Edit: Thanks to Ruud for the explanation.
Last edited by jsoo (2010-02-21 23:10:03)
Code is topiary
Offline