in reply to Simple Session?
sid="39102b7818bf0dc8"Program code:
#!/usr/bin/perl -w my $s=MakeID(); print "sid="$s\"\n"; sub MakeID { # Seed the random generator srand($$|time); $sessionID=int(rand(60000)); # pack the time, process id, and random $session into a # hex number which will make up the sessin ID $session=unpack("H*", pack("Nnn", time, $$, $sessionI +D)); return $session; } #Make ID
|
|---|