in reply to redirect and cookie problems

I am about to give up but I cant since I need to complete this and a few more pages by monday. So will the code below create a cookie. I have it at the top of my program. It does not gernate any errors but I I do not think it created a cookie. I use find on my couputer to look fro a file name 'username' and it comes up with nothing.
use CGI ':standard'; my $query = CGI->new(); my $cookie = $query->cookie(-name=>'username', -values=>"param('name')", -expires=>'+1h', -domain=>'.storm.prohosting'); print $query->header(-cookie=>$cookie);

Replies are listed 'Best First'.
Re: Re: redirect and cookie problems
by Masem (Monsignor) on Jun 15, 2001 at 00:01 UTC
    The domain needs to be the fully qualified or at least the last n-1 parts of the domain name. ".storm.prohosting" is going to fail since there's no TLD associated with it. Presumable, if your server is named "storm.prohosting.com", you want either exactly that or "prohosting.com".

    Cookies are generally saved by the domain name, not by the "name" that you give it, else you run into huge namespace problems. So you want to look for something that has the domain in it, rather than "username".

    Also, I don't know what you are trying to do with the value line. You probably want -value=>$query->param('name'), if you want to set the value of the cookie to whatever the name was passed as in your code.


    Dr. Michael K. Neylon - mneylon-pm@masemware.com || "You've left the lens cap of your mind on again, Pinky" - The Brain