<p dir="ltr">#flamewar #begin! </p>
<p dir="ltr">Uma das coisas que eu acho bom no catalyst é que ele sabe separar as coisas. Parece estranho um framework web não ter Session no core, porém, quem disse que uma web app precisa de session? Websites precisam de sessions, não é necessário em um streaming de vídeo, por exemplo. <br>

Cookies estão no core porém na sua forma mais simples. Existe plugin, quem em 1 linha você já tem os cookies igual à esse exemplo que você passou. </p>
<p dir="ltr">Também tem um ótimo plugin para session, que suporta vários backends para salvar os dados. </p>
<p dir="ltr">Também tem outro plugin, cheio de detalhes, que faz autenticação utilizando cookies e sessions, podendo ou não ser utilizado com outro Role , que já verifica num schema e faz todo o esquema de (um ou vários logins) completamente sozinho. <br>
</p>
<p dir="ltr">Anyway esse catalystX::Auth.. aí eu não conhecia, mas ele é o mais completo, mas ele avisa isso, e dentro dele da pra ver que ele usa sha 512 gerar o cookie de seja lá como a pessoa resolver implementar o próprio auth. </p>

<div class="gmail_quote">Em 23/07/2013 04:59, "Renato Santos" <<a href="mailto:renato.cron@gmail.com">renato.cron@gmail.com</a>> escreveu:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<p dir="ltr">E a partir de agora da pra saber o email e quem está logado só de olhar os cookies. </p>
<div class="gmail_quote">Em 23/07/2013 03:50, "Nelson Ferraz" <<a href="mailto:nferraz@gmail.com" target="_blank">nferraz@gmail.com</a>> escreveu:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div dir="ltr">Tudo isso pra setar um cookie? <div><br></div><div>Sem querer iniciar uma flamewar, mas com o Mojolicious::Lite e' bem simples:<div><br></div><div>#####</div><div><br></div><div>use Mojolicious::Lite;</div>


<div><br></div><div><div>get '/login' => sub {<br></div><div>    my $self = shift;</div><div><br></div><div>    # Query parameters</div><div>    my $user = $self->param('user') || '';</div><div>


    my $pass = $self->param('pass') || '';</div><div><br></div><div><div>    # Store username in session</div><div>    $self->session(user => $user);</div></div><div><br></div><div>} => 'index';</div>


</div><div><br></div><div>app->start();<br></div><div><br></div><div>#####</div></div><div><br></div><div>Isso e' tudo!</div><div><br></div><div>Se voce estiver em duvida, assista aos tutoriais do Mojocast:</div><div>


<br></div><div><a href="http://mojocasts.com/" target="_blank">http://mojocasts.com/</a><br></div><div><br></div><div>Em menos de 30 minutos voce podera' decidir se vale a pena mudar para um framework que (na minha opiniao) te ajudara' a poupar dias de trabalho e frustracao.</div>


<div><br></div><div>Repito: meu objetivo nao e' iniciar um flamewar, mas apenas ajuda'-lo a tomar uma decisao bem informada.</div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/7/22 Daniel de Oliveira Mantovani <span dir="ltr"><<a href="mailto:daniel.oliveira.mantovani@gmail.com" target="_blank">daniel.oliveira.mantovani@gmail.com</a>></span><br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>package Admin;<br>
use Moose;<br>
use namespace::autoclean;<br>
<br>
use Catalyst::Runtime 5.80;<br>
<br>
# Set flags and add plugins for the application.<br>
#<br>
# Note that ORDERING IS IMPORTANT here as plugins are initialized in order,<br>
# therefore you almost certainly want to keep ConfigLoader at the head of the<br>
# list if you're using it.<br>
#<br>
#         -Debug: activates the debug mode for very useful log messages<br>
#   ConfigLoader: will load the configuration from a Config::General file in the<br>
#                 application's home directory<br>
# Static::Simple: will serve static files from the application's root<br>
#                 directory<br>
<br>
use Catalyst qw/<br>
    -Debug<br>
    ConfigLoader<br>
    Static::Simple<br>
/;<br>
<br>
extends 'Catalyst';<br>
</div>with 'CatalystX::AuthenCookie';<br>
<div><div><br>
our $VERSION = '0.01';<br>
<br>
# Configure the application.<br>
#<br>
# Note that settings in admin.conf (or other external<br>
# configuration file that you set up manually) take precedence<br>
# over this when using ConfigLoader. Thus configuration<br>
# details given here can function as a default configuration,<br>
# with an external configuration file acting as an override for<br>
# local deployment.<br>
<br>
__PACKAGE__->config(<br>
    name => 'Admin',<br>
    # Disable deprecated behavior needed by old applications<br>
    disable_component_resolution_r<br>
egex_fallback => 1,<br>
    enable_catalyst_header => 1, # Send X-Catalyst header<br>
);<br>
<br>
# Start the application<br>
__PACKAGE__->setup();<br>
=encoding utf8<br>
<br>
=head1 NAME<br>
<br>
Admin - Catalyst based application<br>
<br>
=head1 SYNOPSIS<br>
<br>
    script/<a href="http://admin_server.pl" target="_blank">admin_server.pl</a><br>
<br>
=head1 DESCRIPTION<br>
<br>
[enter your description here]<br>
<br>
=head1 SEE ALSO<br>
<br>
L<Admin::Controller::Root>, L<Catalyst><br>
<br>
=head1 AUTHOR<br>
<br>
Ricardo,,,<br>
<br>
=head1 LICENSE<br>
<br>
This library is free software. You can redistribute it and/or modify<br>
it under the same terms as Perl itself.<br>
<br>
=cut<br>
<br>
1;<br>
<br>
</div></div><div><div>On 22 July 2013 14:47, Renato Santos <<a href="mailto:renato.cron@gmail.com" target="_blank">renato.cron@gmail.com</a>> wrote:<br>
> No caso, eu não tinha reparado.<br>
><br>
> o modulo não precisa ir no qw//.<br>
><br>
> Coloque o "with 'CatalystX::AuthenCookie';" depois do use Catalyst qw/ ...<br>
> /. assim o moose vai importar¹ as funções desse CatalystX junto com o object<br>
> do Catalyst.<br>
><br>
><br>
> ¹<br>
> <a href="http://search.cpan.org/dist/Moose/lib/Moose/Manual/Roles.pod#WHAT_IS_A_ROLE" target="_blank">http://search.cpan.org/dist/Moose/lib/Moose/Manual/Roles.pod#WHAT_IS_A_ROLE</a>?<br>
><br>
><br>
> On Mon, Jul 22, 2013 at 2:43 PM, Ricardo Alcantara<br>
> <<a href="mailto:alcantarafox@yahoo.com.br" target="_blank">alcantarafox@yahoo.com.br</a>> wrote:<br>
>><br>
>> Seria isso?<br>
>><br>
>> package Admin;<br>
>> use Moose;<br>
>> use namespace::autoclean;<br>
>><br>
>> use Catalyst::Runtime 5.80;<br>
>><br>
>> # Set flags and add plugins for the application.<br>
>> #<br>
>> # Note that ORDERING IS IMPORTANT here as plugins are initialized in<br>
>> order,<br>
>> # therefore you almost certainly want to keep ConfigLoader at the head of<br>
>> the<br>
>> # list if you're using it.<br>
>> #<br>
>> #         -Debug: activates the debug mode for very useful log messages<br>
>> #   ConfigLoader: will load the configuration from a Config::General file<br>
>> in the<br>
>> #                 application's home directory<br>
>> # Static::Simple: will serve static files from the application's root<br>
>> #                 directory<br>
>><br>
>> use Catalyst qw/<br>
>>     -Debug<br>
>>     ConfigLoader<br>
>>     Static::Simple<br>
>> /;<br>
>><br>
>> extends 'Catalyst';<br>
>><br>
>> our $VERSION = '0.01';<br>
>><br>
>> # Configure the application.<br>
>> #<br>
>> # Note that settings in admin.conf (or other external<br>
>> # configuration file that you set up manually) take precedence<br>
>> # over this when using ConfigLoader. Thus configuration<br>
>> # details given here can function as a default configuration,<br>
>> # with an external configuration file acting as an override for<br>
>> # local deployment.<br>
>><br>
>> __PACKAGE__->config(<br>
>>     name => 'Admin',<br>
>>     # Disable deprecated behavior needed by old applications<br>
>>     disable_component_resolution_regex_fallback => 1,<br>
>>     enable_catalyst_header => 1, # Send X-Catalyst header<br>
>> );<br>
>><br>
>> # Start the application<br>
>> __PACKAGE__->setup();<br>
>> =encoding utf8<br>
>><br>
>> =head1 NAME<br>
>><br>
>> Admin - Catalyst based application<br>
>><br>
>> =head1 SYNOPSIS<br>
>><br>
>>     script/<a href="http://admin_server.pl" target="_blank">admin_server.pl</a><br>
>><br>
>> =head1 DESCRIPTION<br>
>><br>
>> [enter your description here]<br>
>><br>
>> =head1 SEE ALSO<br>
>><br>
>> L<Admin::Controller::Root>, L<Catalyst><br>
>><br>
>> =head1 AUTHOR<br>
>><br>
>> Ricardo,,,<br>
>><br>
>> =head1 LICENSE<br>
>><br>
>> This library is free software. You can redistribute it and/or modify<br>
>> it under the same terms as Perl itself.<br>
>><br>
>> =cut<br>
>><br>
>> 1;<br>
>><br>
>><br>
>> =begin disclaimer<br>
>>   Sao Paulo Perl Mongers: <a href="http://sao-paulo.pm.org/" target="_blank">http://sao-paulo.pm.org/</a><br>
>> SaoPaulo-pm mailing list: <a href="mailto:SaoPaulo-pm@pm.org" target="_blank">SaoPaulo-pm@pm.org</a><br>
>> L<<a href="http://mail.pm.org/mailman/listinfo/saopaulo-pm" target="_blank">http://mail.pm.org/mailman/listinfo/saopaulo-pm</a>><br>
>> =end disclaimer<br>
><br>
><br>
><br>
><br>
> --<br>
> Saravá,<br>
> Renato CRON<br>
> <a href="http://www.renatocron.com/blog/" target="_blank">http://www.renatocron.com/blog/</a><br>
> @renato_cron<br>
><br>
> =begin disclaimer<br>
>    Sao Paulo Perl Mongers: <a href="http://sao-paulo.pm.org/" target="_blank">http://sao-paulo.pm.org/</a><br>
>  SaoPaulo-pm mailing list: <a href="mailto:SaoPaulo-pm@pm.org" target="_blank">SaoPaulo-pm@pm.org</a><br>
>  L<<a href="http://mail.pm.org/mailman/listinfo/saopaulo-pm" target="_blank">http://mail.pm.org/mailman/listinfo/saopaulo-pm</a>><br>
> =end disclaimer<br>
><br>
<br>
<br>
<br>
--<br>
<br>
</div></div><div>-dom<br>
<br>
--<br>
<br>
IBM - Business Analytics Optimization Consultant<br>
Daniel Mantovani <a href="tel:%2B5511%208538-9897" value="+551185389897" target="_blank">+5511 8538-9897</a><br>
XOXO<br>
</div><div><div>=begin disclaimer<br>
   Sao Paulo Perl Mongers: <a href="http://sao-paulo.pm.org/" target="_blank">http://sao-paulo.pm.org/</a><br>
 SaoPaulo-pm mailing list: <a href="mailto:SaoPaulo-pm@pm.org" target="_blank">SaoPaulo-pm@pm.org</a><br>
 L<<a href="http://mail.pm.org/mailman/listinfo/saopaulo-pm" target="_blank">http://mail.pm.org/mailman/listinfo/saopaulo-pm</a>><br>
=end disclaimer<br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>Nelson Ferraz
</div>
<br>=begin disclaimer<br>
   Sao Paulo Perl Mongers: <a href="http://sao-paulo.pm.org/" target="_blank">http://sao-paulo.pm.org/</a><br>
 SaoPaulo-pm mailing list: <a href="mailto:SaoPaulo-pm@pm.org" target="_blank">SaoPaulo-pm@pm.org</a><br>
 L<<a href="http://mail.pm.org/mailman/listinfo/saopaulo-pm" target="_blank">http://mail.pm.org/mailman/listinfo/saopaulo-pm</a>><br>
=end disclaimer<br>
<br></blockquote></div>
</blockquote></div>