Code:
<?php #defining the class class sessionId { #defining properties public $length = 10; public $characters = "0123456789abcdefghijklmnopqrstuvwxyz"; public $string = " "; #defining the salt method public function GenSaltString() { #this is where the magic happens for ($x = 0; $x < $this->length; $x++) { $this->string .= $this->characters[mt_rand(0,strlen($this->characters)-1)]; $session=md5(sha1($this->string)); $ses=strtoupper(substr($session,$x,12)); } return $ses; } }
instead of using sessions i made this simple snippet that may be handy for people that are making secured sites and dont like using sessons. it's very easy to manipulate.
Comment