Changeset 11


Ignore:
Timestamp:
Apr 19, 2003, 8:52:02 PM (19 years ago)
Author:
kake
Message:

Added Earle's cookie patch to allow for case where no cookie set

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wiki.cgi

    r10 r11  
    428428
    429429sub get_cookie {
    430         my %cookies = fetch CGI::Cookie;
    431         my $cookie = $cookies{'username'}->value;
    432         return $cookie;
     430    my %cookies = fetch CGI::Cookie;
     431    my $cookie;
     432    if ($cookies{'username'}) {
     433        $cookie = $cookies{'username'}->value;
     434    }
     435    else {
     436        $cookie = "Anonymous User";
     437    }
     438    return $cookie;
    433439}
    434440
Note: See TracChangeset for help on using the changeset viewer.