#!/usr/bin/perl -w
######################################################################
# (c) Michael Schilli 1999
######################################################################

use CGI qw/:standard/;

if(defined ($wert=cookie(-name => 'Schluessel'))) {
         
    print header();                          # Cookie gesetzt,
    print h1("Cookie gesetzt: $wert");       # Wert ausgeben

} else {                            
    $cookie = cookie(              # Cookie nicht gesetzt, 
                                   # erzeugen
      '-name'    => 'Schluessel',  # Name des Cookies
      '-value'   => "Wert!",       # Wert des Cookies
      '-expires' => '+1h',         # 1 Stunde haltbar
      '-domain'  => '.gauner.com', # Gültig für www.gauner.com,
                                   # host.gauner.com etc.
      '-path'    => '/cgi-bin',    # Nur für CGI-Skripts
      '-secure'  => 0              # Nicht nur für HTTPS-Server
    );
    print header('-cookie' => $cookie);
    print h1("Cookie übermittelt!");
}
