<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.6000.16587" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face="Trebuchet MS" size=2>Minha dica é a seguinte:</FONT></DIV>
<DIV><FONT face="Trebuchet MS" size=2></FONT>&nbsp;</DIV>
<DIV><FONT face="Trebuchet MS" size=2>Utilize a função de espalhamento, 
conhecida como MD5 (do módulo "Digest")</FONT></DIV>
<DIV><FONT face="Trebuchet MS" size=2></FONT>&nbsp;</DIV>
<DIV><FONT face="Trebuchet MS" size=2>faça uma função pegando: "time" e "$pid", 
se possível também pegue o nome do usuário.</FONT></DIV>
<DIV><FONT face="Trebuchet MS" size=2></FONT>&nbsp;</DIV>
<DIV><FONT face="Trebuchet MS" size=2>Com essa três informações pode-se criar um 
sessionID com o "md5_hex" do Digest:MD5</FONT></DIV>
<DIV><FONT face="Trebuchet MS" size=2></FONT>&nbsp;</DIV>
<DIV><FONT face="Trebuchet MS" size=2>usando a função md5_hex a possibilidade de 
criar um mesmo sessionID é de 2**128 (dois na cento e vinte e oito)</FONT></DIV>
<DIV><FONT face="Trebuchet MS" size=2></FONT>&nbsp;</DIV>
<DIV><FONT face="Trebuchet MS" size=2>[]s,</FONT></DIV>
<DIV><FONT face="Trebuchet MS" size=2>Fernando</FONT></DIV>
<DIV><FONT face="Trebuchet MS" size=2></FONT>&nbsp;</DIV>
<BLOCKQUOTE 
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
  <DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
  <DIV 
  style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B> 
  <A title=rafamv1@ig.com.br href="mailto:rafamv1@ig.com.br">Rafael Lebrao 
  Martins</A> </DIV>
  <DIV style="FONT: 10pt arial"><B>To:</B> <A title=cascavel-pm@pm.org 
  href="mailto:cascavel-pm@pm.org">cascavel-pm@pm.org</A> </DIV>
  <DIV style="FONT: 10pt arial"><B>Sent:</B> Wednesday, January 30, 2008 11:03 
  AM</DIV>
  <DIV style="FONT: 10pt arial"><B>Subject:</B> [Cascavel-pm] "Carregar" session 
  id.</DIV>
  <DIV><BR></DIV>
  <P>Bom dia, pessoal. Criei um código para gerar um session id, mas agora não 
  sei <BR>como "carregar" esse id em todos os códigos do programa, permitindo o 
  acesso apenas<BR>se o id estiver contido na url. </P>
  <P>Esse código gera o ID:</P>
  <P>#!/usr/bin/perl</P>
  <P>use warnings;<BR>use strict;<BR>use CGI qw ( :standard);<BR>use 
  CGI::Session qw/-ip-match/;</P>
  <P>my $file = '/var/www/cgi-bin/imm/sid.txt';<BR>open( SID, '&gt;', "$file" 
  );</P>
  <P>my $path_sessoes = '/tmp';<BR>my $login;<BR>my $session =<BR>&nbsp; new 
  CGI::Session( "driver:File", undef, { 'Directory' =&gt; "$path_sessoes" } 
  );<BR>$session-&gt;param( 'teste_tmg', "$login" );<BR>$session-&gt;param( 
  '_IDLE_EXPIRY' =&gt; time + 1800 );<BR>$session-&gt;expire('+1d');<BR>my $sid 
  = $session-&gt;id();</P>
  <P>print( SID "$sid" );<BR>close(SID);<BR></P>
  <P>
  <HR>

  <P></P>_______________________________________________<BR>Cascavel-pm mailing 
  list<BR>Cascavel-pm@pm.org<BR>http://mail.pm.org/mailman/listinfo/cascavel-pm</BLOCKQUOTE></BODY></HTML>