×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Delete Cookie ..

Delete Cookie ..

Delete Cookie ..

(OP)
Whats wrong with this, it causes a 'Internal Server Error' ..

use CGI qw(:all);
use CGI::Cookie;

my $cookie = $q->cookie (
                -name    => 'COOKIENAME',
                -value   => '',
                -path    => '/',
                -expires => '-1d'
 );

print $q->header(-cookie => $cookie);

<html>
....
</html>

RE: Delete Cookie ..

Maybe it's because your HTML code is just out there in the open?

Try this:

CODE

use CGI qw(:all);
use CGI::Cookie;

my $cookie = $q->cookie (
                -name    => 'COOKIENAME',
                -value   => '',
                -path    => '/',
                -expires => '-1d'
 );

print $q->header(-cookie => $cookie);

print qq~<html>
....
</html>~;

(just make sure your html code doesn't have a ~ symbol in it and it will work just fine. If it does have a ~, escape it with \~)

RE: Delete Cookie ..

check the server error log, probably has something like:

Can't call method "cookie" on an undefined value at yourscript.pl line xx.

CODE

use CGI;
my $q = CGI->new;

my $cookie = $q->cookie (
                -name    => 'COOKIENAME',
                -value   => '',
                -path    => '/',
                -expires => '-1d'
 );

print $q->header(-cookie => $cookie);

print qq~<html>
....
</html>~;

RE: Delete Cookie ..

Here's a thing

internal server error

and there's no real FAQ on how to resolve it, we just keep answering the same thing over and over ...

anyone up for it? winky smile

point:
If you write an FAQ, link to a thread, that others may contribute, ... wish I did that blllttt

just a thought ...

Paul
------------------------------------
Spend an hour a week on CPAN, helps cure all known programming ailments winky smile

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close