[Cascavel-pm] Problemas com Cookie

Glauber Machado Rodrigues (Ananda) glauber.rodrigues em gmail.com
Sexta Dezembro 11 02:56:07 PST 2009


2009/12/11 Sammuel Souza <sammuel.souza em gmail.com>

> (...)
>
> my $server_nome = $ENV{'SERVER_NAME'};
>
> (vou pular algumas partes ir direto ao cookie)
>
> my $c = new CGI::Cookie(-name    =>  'cseguranca',
>                         -value   =>  "$seguranca_codigo",
>                         -domain  =>  "$server_nome",
>                         -expires =>  '+1M',
>                         -path    =>  '/',
>                         -secure  =>  0
>                        );
>
> print "Set-Cookie: $c\n";
>
> Ele nao gera o cookie na maquina cliente, verifiquei o
> $server_nome esta pegando o ip da maquina 192.168.254.10
> (...)
> Ja fiz outro scritp só para gerar um cookie tmb não cria.
>
> Alguem tem alguma sugestão?
>
Acredito que o atributo "domain" não pode ser um ip.

Se você não especificar o domain, acho que vai ter o efeito parecido com o
que você quer:

http://search.cpan.org/~lds/CGI.pm-3.48/lib/CGI/Cookie.pm#USING_CGI::Cookie
"""
2. domain

    This is a partial or complete domain name for which the cookie is valid.
The browser will return the cookie to any host that matches the partial
domain name. For example, if you specify a domain name of ".capricorn.com",
then Netscape will return the cookie to Web servers running on any of the
machines "www.capricorn.com", "ftp.capricorn.com", "feckless.capricorn.com",
etc. Domain names must contain at least two periods to prevent attempts to
match on top level domains like ".edu". If no domain is specified, then the
browser will only return the cookie to servers on the host the cookie
originated from.
""


-- 
Existe mais de uma maneira de chegar lá

Glauber Machado Rodrigues

skype: glauber.rodrigues
-------------- Próxima Parte ----------
Um anexo em HTML foi limpo...
URL: <http://mail.pm.org/pipermail/cascavel-pm/attachments/20091211/7088b1d0/attachment-0001.html>


Mais detalhes sobre a lista de discussão Cascavel-pm