Index: proxy.php
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/mappingkit/Attic/proxy.php,v
retrieving revision 1.1.2.4
diff -u -r1.1.2.4 proxy.php
--- proxy.php	16 Nov 2008 20:51:21 -0000	1.1.2.4
+++ proxy.php	26 Jan 2009 08:18:25 -0000
@@ -22,11 +22,20 @@
   $ch = '&';
 }
 
-if (isset($_GET['debug'])) {
-  die( var_export(array($url, $_GET, $_REQUEST), true) );
+// Proxy request should pass on cookie headers to prevent Drupal from
+// ending a session. Note: only if same host as this site!
+$headers = array();
+if (!empty($_COOKIE)) {
+  $cookies = ''; $ch = '';
+  foreach ($_COOKIE as $key => $value) {
+    $cookies .= $ch . $key . '=' . $value;
+    $ch = '; ';
+    //setcookie($key, $value, time() + 3600);
+  }
+  $headers['Cookie'] = $cookies;
 }
 
-$response = drupal_http_request($url);
+$response = drupal_http_request($url, $headers);
 if ($response->error) {
   header('HTTP/1.1 404 Not Found');
   echo var_export($response, true);
