|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
how do you use Perl to write out cookies. I've got it down in JavaScript, but I'd like to switch it to server-side, and I'm already using perl, so it seems most logical here. are there any references or tutorials on the web maybe? THANKS!!! CujoRbd |
|
#2
|
|||
|
|||
|
There are many ways to use it. You can use CGI.pm or try HTTP:Cookies from -> http://www.perl.com/CPAN-local/modules/by-module/HTTP/libwww-perl-5.48.tar.gz
Extract it and read Cookies.pm in HTTP directory. |
|
#3
|
|||
|
|||
|
A simple example using CGI.pm....
<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre> #!/usr/local/bin/perl use CGI; # change the next line to your cgi-bin dir. $thisCGI = '/cgi-bin/examples/setCookie'; $query = new CGI; $cookThis = $query->cookie(-name=>'cookThis'); if ($cookThis) { $cookie = $query->cookie(-name=>"cookThis", -value=>'', -expires=>"+1h"); } else { $cookie = $query->cookie(-name=>"cookThis", -value=>"Netscape Version", -expires=>"+1h"); } print $query->header(-cookie=>$cookie); print "<BR>CookThis is $cookThis<BR>"; print $query->start_html(-title=>"UPLOAD THIS"); print $query ->start_multipart_form('POST',"$thisCGI"); print '<BR>',$query->submit('doWhat','cook'); print $query->end_form; print $query->end_html; [/code] 'hope this helps... |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Perl Programming > cookies?? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|