[HOWTO] FCKeditor uploads with Shared Sign-On (and Domain Access)

Jomel - September 23, 2008 - 11:00
Project:Shared Sign-On
Version:5.x-1.3
Component:Code
Category:support request
Priority:normal
Assigned:Unassigned
Status:active
Description

FCKeditor requires you to set $cookie_domain for its upload functionality (the uploader bootstraps Drupal and needs to be able to read your cookies). Unfortunately, if you have multiple domains using Domain Access and rely on Shared Sign-On for authentication, you can't just set $cookie_domain = 'mydomain.com'

However it seems to work if you automatically generate the $cookie_domain from $_SERVER['HTTP_HOST'], by putting the following two lines in your settings.php

<?php
preg_match
('/[^.]+\.[^.]+$/', $_SERVER['HTTP_HOST'], $cookie_domain_matches);
$cookie_domain = $cookie_domain_matches[0];
?>

I'm mainly posting this to help anyone else looking for a solution, though I'd be interested to know if there are any downsides to doing this.

 
 

Drupal is a registered trademark of Dries Buytaert.