Skip to content

Instantly share code, notes, and snippets.

@enigmaticape
Created October 26, 2012 15:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save enigmaticape/3959296 to your computer and use it in GitHub Desktop.
Save enigmaticape/3959296 to your computer and use it in GitHub Desktop.
<?php
if( ($dir = session_save_path() ) == null ) {
$dir = sys_get_temp_dir();
}
var_dump( $dir );
if( $dir ) {
$dh = opendir($dir);
if( $dh ) {
while( ($file = readdir( $dh )) !== false ) {
var_dump( $file );
// Uncommenting the following will dump the contets
// of the files, your provider may become cross
// if you do this
/*
$contents = file_get_contents( $dir."/".$file );
var_dump( $contents );
*/
}
}
}
?>
@enigmaticape
Copy link
Author

PHP code to have a look at what's up in your shared hosts temp dir, where are your PHPSESSION stuff is probably being kept. From an article on PHP session security at http://www.enigmaticape.com/blog/some-notes-gathered-on-php-session-security/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment