Sending session ID without cookie

From: Date: Tue, 13 Jan 2004 09:54:27 +0000
Subject: Sending session ID without cookie
Groups: php.general 
Request: Send a blank email to php-general+get-174415@lists.php.net to get a copy of this message
Hi, I'm trying to send my session ID using POST/GET auto-inserted by PHP. This works like a charm in a .php file. But in a .cgi file, a new PHPSSID appears in the Address field of my browser every time I follow the link from the file to itself. What may be causing this? I have had some big problems sending cookie headers from .cgi files like this. So I want additional stuff to stay out of my header. It was my ISP who told me to explicitly write the Content-type line. Here's my code: #! /usr/local/bin/php <?php ini_set ("session.use_cookies", "0"); ini_set ("session.use_only_cookies", "0 "); session_start(); print 'Content-Type: text/html' . "\n\n"; // required in .cgi file print '<html><body>' . "\n"; if (!isset($_SESSION['count'])) $_SESSION['count'] = 1; else $_SESSION['count']++; print 'Visit number ' . $_SESSION['count'] . '<br>'; print '<a href="test5.cgi"> Go again </a>'; print '</body></html>' . "\n"; ?> Greetings, Børge

« previous php.general (#174415) next »