Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
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?
[marto]: Morning, looks like our client office will be closed due to bad weather

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (6)
As of 2018-01-17 07:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How did you see in the new year?










    Results (196 votes). Check out past polls.

    Notices?