This is the default run mode in a project that I am working on. The
goal is to see if the visitor has been
to the site before. The thought here is that cookies are the best (if
not only) way to do this. The problem
is interesting. I am getting the following error messages:
[Wed Sep 26 12:07:44 2001] index.cgi: Use of uninitialized value in
string eq at Engine.pm line 26
I am attempting to see if the cookie is already set. Does anyone have a
better way of doing this? I am still
pretty new to CGI::App.
13: sub start
14: {
15: # Local Variables
16: my $self = shift;
17: my $pageRequested = '';
18: my $cookieValue = '';
19: my $cookieHeader = '';
20: my $req = $self->query();
21:
22: # Get the cookie
23: $cookieValue = $req->cookie("userID");
24:
25: # Test to see if the cookie was set
26: if ($cookieValue eq "")
27: {
28: # This is a first time visitor or they have deleted thier
cookie Lets set a new cookie.
29: my $packed_cookie = $req->cookie( -NAME => "userID",
30: -VALUE =>
"someUniqueIdentifier",
31: -path=>'/',
32: -domain=>'.dshack.com',
33: -EXPIRES => "+1m");
34: my $cookieHeader = $req->header(-COOKIE => $packed_cookie);
35: }
36: else
37: {
38: # They have already been here!
39: }
40:
I am also not sure what to do with $cookieHeader now that I have it.
Should I do something like this? This
does not appear to be working.
# Load the template into output
my $output = $cookieHeader . $t->output();
# Return the output
return $output;
Thanks in Advance,
Kenny Pyatt
Owner
Design Shack
www.dshack.com
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]