]> andersk Git - sql-web.git/blobdiff - lib/mitsql.lib.php
git-svn-id: svn://presbrey.mit.edu/sql/mitsql@73 a142d4bd-2cfb-0310-9673-cb33a7e74f58
[sql-web.git] / lib / mitsql.lib.php
index b275c304b8991b0e7a7cae02ba1bc559be4b3cd4..c59a4347e776573ff2d6e91dc6c19cc7badb9c69 100755 (executable)
@@ -13,10 +13,18 @@ require_once('security.lib.php');
 
 require_once('display.lib.php');
 
+if (isset($_SERVER['SERVER_NAME'])) {
+       $BASE_URL = 'http'.(isSSL()?'s':'').'://'.$_SERVER['SERVER_NAME'].BASE_URL;
+} else {
+       $BASE_URL = 'http://sql.mit.edu/';
+}
+
 if (isset($_SERVER['REQUEST_URI'])) {
     //$thisPath=pathinfo($_SERVER['REQUEST_URI']);
     //session_set_cookie_params(0, $thisPath['dirname']);
-    session_set_cookie_params(0, $BASE_URL);
+       //$arr = explode('/', $_SERVER['SCRIPT_NAME']);
+    //session_set_cookie_params(0, '/'.$arr[1].'/');
+    session_set_cookie_params(0, BASE_URL);
     session_start();
     define('INTERACTIVE', 1);
 } else {
This page took 0.025074 seconds and 4 git commands to generate.