]> git.joonet.de Git - adminer.git/commitdiff
Unobtrusive session cookie
authorjakubvrana <jakubvrana@7c3ca157-0c34-0410-bff1-cbf682f78f5c>
Fri, 27 Jul 2007 11:53:04 +0000 (11:53 +0000)
committerjakubvrana <jakubvrana@7c3ca157-0c34-0410-bff1-cbf682f78f5c>
Fri, 27 Jul 2007 11:53:04 +0000 (11:53 +0000)
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@278 7c3ca157-0c34-0410-bff1-cbf682f78f5c

_compile.php
index.php

index 18eb1d8ef64b61d5a43d34e4315155feaa26868c..f0ef9344e591f633553d4043ebdb47d64f961dbf 100644 (file)
@@ -64,7 +64,7 @@ if ($_COOKIE["lang"]) {
 }
 $file = str_replace("favicon.ico", '<?php echo preg_replace("~\\\\?.*~", "", $_SERVER["REQUEST_URI"]) . "?favicon="; ?>', $file);
 $file = str_replace("arrow.gif", '" . preg_replace("~\\\\?.*~", "", $_SERVER["REQUEST_URI"]) . "?gif=arrow', $file);
-$file = str_replace('session_start();', "if (isset(\$_GET['favicon'])) {\n\theader('Content-Type: image/x-icon');\n\techo base64_decode('" . base64_encode(file_get_contents("favicon.ico")) . "');\n\texit;\n} elseif (isset(\$_GET['gif'])) {\n\theader('Content-Type: image/gif');\n\techo base64_decode('" . base64_encode(file_get_contents("arrow.gif")) . "');\n\texit;\n}\n\nsession_start();", $file);
+$file = str_replace('error_reporting(E_ALL & ~E_NOTICE);', "error_reporting(E_ALL & ~E_NOTICE);\nif (isset(\$_GET['favicon'])) {\n\theader('Content-Type: image/x-icon');\n\techo base64_decode('" . base64_encode(file_get_contents("favicon.ico")) . "');\n\texit;\n} elseif (isset(\$_GET['gif'])) {\n\theader('Content-Type: image/gif');\n\techo base64_decode('" . base64_encode(file_get_contents("arrow.gif")) . "');\n\texit;\n}", $file);
 $file = str_replace('<link rel="stylesheet" type="text/css" href="default.css" />', "<style type='text/css'>\n" . file_get_contents("default.css") . "</style>", $file);
 file_put_contents($filename, $file);
 echo "$filename created.\n";
index bd2a8e9241b3ada66b3549a3c73f4c24e3483cc1..95c64cc8b56041c95872348c55ad88a3fccfc715 100644 (file)
--- a/index.php
+++ b/index.php
@@ -1,8 +1,10 @@
 <?php
 // Copyright 2007 Jakub Vrana http://phpminadmin.sourceforge.net, licensed under the Apache License, Version 2.0 (the 'License'); you may not use this file except in compliance with the License.
 
-session_start();
 error_reporting(E_ALL & ~E_NOTICE);
+session_name("PHPSESSID");
+session_set_cookie_params(ini_get("session.cookie_lifetime"), preg_replace('~\\?.*~', '', $_SERVER["REQUEST_URI"]));
+session_start();
 $SELF = preg_replace('~^[^?]*/([^?]*).*~', '\\1?', $_SERVER["REQUEST_URI"]) . (strlen($_GET["server"]) ? 'server=' . urlencode($_GET["server"]) . '&' : '') . (strlen($_GET["db"]) ? 'db=' . urlencode($_GET["db"]) . '&' : '');
 $TOKENS = &$_SESSION["tokens"][$_GET["server"]][$_SERVER["REQUEST_URI"]];
 include "./functions.inc.php";