Search code examples
perlcookiesmojolicious

Mojolicious Not Setting Cookie Domain


I have been trying to set a cookie for my domain in this certain Mojolicious application and it will not do it. It keeps setting it to the local machine's domain.

 $c->cookie(
            goto => "DATA",
            { domain => ".mydomain.edu", path => '/' }
        );

I have been looking at this for hours and just can't seem to see where it is going wrong.

Any ideas?


Solution

  • Changed:

    $c->cookie(
                    goto => encode_base64('data'),
                    { domain => ".mydomain.edu", path => '/' }
                );
    

    TO:

     $goto = encode_base64('data');
     $c->cookie(
                        goto => $goto,
                        { domain => ".mydomain.edu", path => '/' }
                    );