Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

BigJoe's scratchpad

by BigJoe (Curate)
on Jun 02, 2004 at 23:00 UTC ( #359808=scratchpad: print w/ replies, xml ) Need Help??

sub CREATE_NEW_SESSION_ID { ######################################### # Joseph Harnish # # 1/29/2002 # # This creates a session ID # ######################################### ########################################### # I am getting a random length of the # # sessin id to make it harder to crack # ########################################### my $session_id_length = int( rand(14)) + 6; my $session_id = ""; for (my $i = 0; $i <= $session_id_length; $i++){ my $temp = int( rand(36)); if($temp > 9){ $temp = chr($temp + 55); my $upper_or_lower_rand = int( rand (2)); $temp = lc($temp) if($upper_or_lower_rand == 1); } $session_id .= $temp; } $sth= $dbh->prepare("select count(*) from WEB3_Session where sessi +on_id='$session_id'"); $sth->execute; my $num_of_sessions = $sth->fetchrow_array; $sth->finish; $session_id = CREATE_NEW_SESSION_ID () if ( $num_of_sessions > 0); return $session_id; }
Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (8)
As of 2015-07-08 02:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (93 votes), past polls