note 79726 deleted from ref.session by felipe

[email protected]
Newsgroups php.notes
Message-ID <[email protected]>
Note Submitter: xeonnn at gmail dot com 

----

You can build a verry safe session with the following code:

<?php
session_start();

$sessionID = md5(uniqid(rand(), true));

if(isset($_GET['geef']))
{
  if(isset($_SESSION['id']) && isset($_GET['sessie']) && $_GET['sessie'] == $_SESSION['id']) 
  {
    echo "goed!";
  }
  else
  {
    echo "niet hacken kutjong";
  }
}
else
{
  $_SESSION['id'] = $sessionID;
  
  echo "<a href='".$_SERVER['PHP_SELF']."?geef&sessie=".$sessionID."'>Sessie weergave</a>";
}

?>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.