Other way to match the session without change cookie_domain?
shadowhitman - January 31, 2009 - 10:03
| Project: | KnowledgeTree integration |
| Version: | 6.x-1.3 |
| Component: | Miscellaneous |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Description
Thanks for the nice module,
I'm able to Integrate the Drupal with Knowledge tree only if I set my cookie _domain,
but the problem is my integration with Mantis doesn't work if the cookie_domain is enabled.
Do you have any other way to do this? may be using Services module?
Thank you very much

#1
Not at the moment... I have considered trying to use the services module to remove the pain of the session matching issues but the session doesn't link the applications it identifies the user so it's more involved than a quick implementation - unfortunately.
Looking at the bugbits code (I assume that's what you are using to join mantis and Drupal) maybe you can fix the issue by setting the domain in the bugbits_setcookie and bugbits_clear_cookie functions...
For example
<?php
function bugbits_setcookie($mantis_id) {
global $cookie_domain;
$name = 'MANTIS_STRING_COOKIE';
$length = 300000000 + time();
$path = '/';
//$domain = '';
if ($user_string = bugbits_cookie_string($mantis_id)) {
return setcookie($name, $user_string, $length, $path, $cookie_domain);
}
else {
return false;
}
}
function bugbits_clear_cookie() {
global $cookie_domain;
$name = 'MANTIS_STRING_COOKIE';
$length = - 1;
$path = '/';
//$domain = '';
return setcookie($name, '', $length, $path, $cookie_domain);
}
?>
If this works perhaps lets the bugbits team know...
#2
Ok, thank you very much for your feedback,
I set the $base_url to my drupal installation path, and the it works perfectly.
I didn't use bugbits, because I setup the server last year,and they haven't ported it to Drupal 6,
I just used a tutorial from internet.
Again,thanks for your help :)