
Originally Posted by
marain
One of the items on the checklist is "8.Make sure your file extension is .php (it happens!)". My site sets defines the session index in a file with a .php extension, but it redirects to a .txt extension!
The takeaway from that is to make sure that the file is actually being executed as PHP. As long as you're including it it and/or executing it as a PHP file, everything should work out fine. However, if you do want to test and make sure this isn't the issue, here's another case you can run:
index.php
PHP Code:
<?php
session_start();
if( isset( $_GET[ 'session-set' ] ))
{
include( 'detect.txt' );
session_unset();
exit;
}
$_SESSION[ 'foo' ] = true;
header( 'Location: index.php?session-set' );
detect.txt
PHP Code:
<?php
echo isset( $_SESSION[ 'foo' ] ) ? "Session worked." : "Session failed.";
If this returns session failed, the text file is not necessarily the issue and we'd have to do further debugging to verify.

Originally Posted by
marain
I attempted to try it, got 404-type error.
Sorry, make sure that the PHP file is called "redirect.php", otherwise the script redirects to another page. (Or just modify the script, whatever you feel is easier).
Bookmarks