The reason was the following:

I was reading cookies on template side:
cat ../Web/templates/search/result.html.ep 
% layout 'default';
<...>
% my @cookies = $self->signed_cookie('q');
<...>
my %vals = Sym::Controller::Search->intersect(<...>)
<%= include 'search/intersect' … %>

And then I did the same on controller side (apparently if I do it only on 
Controller side it's just do not work — I can't read the cookies then)

package Sym::Controller::Search
sub result {
<...>
}
<…>
sub intersect {
<…>
my @cookies = $self->signed_cookie('q');
<…>
return \%vals
}

As soon as I have removed the last string (i.e. my @cookies = 
$self->signed_cookie('q') ) in Search.pm everything went just fine!

Sometimes this double code (though not a bug…) works anyway… For instance I 
found that in sub result {<...>} I still have it, but it works.


One more time just in case. It was just fine with previous Mojolicious — I 
have changed absolutely nothing before upgrade. I do agree that code may 
not be purely correct, but anyway using cookies needs more explanations 
about how they are read in Mojolicious.

P.S. 
hypnotoad still looses DB conection to MongoDB and this never happens using 
$ myapp daemon

Cheers, —
Catherine


On Friday, 29 August 2014 17:53:26 UTC+1, Cathe wrote:
>
> Hello guys,
>
> v5.33
> Cannot read cookies as I did before.
>
> use Pkg;
> …
> sub mo {
> ...
> my @cookies = $self->cookie('foo');
> ...
> return …
> }
> — this doesn't work any longer…
>
> I get «Can't use string ("Pkg") as a HASH ref while …» 
> — actually the package has just stopped to work, because everything is 
> fine if I do:
> …
> my @cookies = (); 
> …
> etc
>
> %|
>
> Any ideas? If it's not my mistake somehow — is there any doc where all 
> changes are described (with $self->secret etc too)
> people usually write «is going to be depricated» before to remove a method
> please please do it
> otherwise there is no fun at all to support an app written on Mojolicious… 
> 8(
>
> Sorry…
>
> Cheers!
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.

Reply via email to