[dancer-users] session JSON with é à

Nick Knutov mail at knutov.com
Thu May 8 11:29:47 BST 2014


D::Session::Cookie is not just cookies, all data is encrypted and safe,
it's just stored in cookie. User is not able no read or modify this data
from the browser side.

The only good reasons (as I think) to have server-side sessions are:
1) to be able to count logged users,
2) to have multiple sessions per user (log-ins from multiple places like
at livejournal) and
3) be able to terminate session from server side.

And yes, Dancer::Session::Redis is good solution to store server-side
cookies in memory and do not lose iops on the disk.

Yes, encrypted cookie is bigger then just session id. But you will not
see any difference on fast connection. With slow connection it is more
complex. Traffic can be sufficiently increased in case you have a lot of
small images on the page (in separate files) and you are not using
SPDY(or HTTP 2.0). But this is bad way regardless of the choice of side
to store sessions.


08.05.2014 15:47, Hugues пишет:
> yes maybe but I store some private info on user session
> I prefer to keep on the server.
> 
> and if I save iops I loose on network bandwidth and speed , no ?
> 
> I think about Dancer::Session::Redis do you test it ?
> 
> Hugues.
> 
> Le 08/05/2014 11:40, Nick Knutov a écrit :
>> use utf8::all may help.
>>
>> D::Session::Cookie is faster (and saves iops/SSD)
>>
>>
>> 08.05.2014 14:35, Stefan Hornburg (Racke) пишет:
>>> On 05/08/2014 10:21 AM, Hugues wrote:
>>>> Hello
>>>> I found a strange problem with my D1 app
>>>>
>>>> in my config.yml
>>>>
>>>> charset: "UTF-8"
>>>> template: "template_toolkit"
>>>> engines:
>>>> template_toolkit:
>>>> encoding: 'utf8'
>>>> start_tag: '[%'
>>>> end_tag: '%]'
>>>>
>>>> serializer: 'JSON'
>>>> session: 'JSON'
>>>>
>>>> all characters with accent appear encoding
>>>>
>>>> cat sessions/142370789218895586385667162125359748.json | jq .
>>>>
>>>> "MemoAction": "2014-05-08 001 RESET-ARRET/MARCHE
>>>> ���©���©���© \r\n",
>>>> "MemoPanne": " 2014-05-08 001 PB BATTERIE
>>>> ���©���©���©���© \r\n"
>>>>
>>>>
>>>> if I use session: 'YAML' in config.yml all is ok
>>>>
>>>> cat sessions/295483594817224343797619192129361122.yml
>>>>
>>>> MemoAction: "2014-05-08 001 RESET-ARRET/MARCHE éééé \r\n"
>>>> MemoPanne: " 2014-05-08 001 PB BATTERIE \r\n2014-05-08 001 PB
>>>> BATTERIE ééé \r\n"
>>>>
>>>> I do something special with json session ?, I tried to encode/decode
>>>> without success
>>>> ( all this text come from web user )
>>>>
>>> That is most likely a bug with Dancer::Session::JSON.
>>>
>>> Sawyer?
>>>
>>> BTW: I would recommend to use a faster file based session engine for
>>> production.
>>>
>>> Regards
>>>     Racke
>>>
> 
> _______________________________________________
> dancer-users mailing list
> dancer-users at dancer.pm
> http://lists.preshweb.co.uk/mailman/listinfo/dancer-users

-- 
Best Regards,
Nick Knutov
http://knutov.com
ICQ: 272873706
Voice: +7-904-84-23-130


More information about the dancer-users mailing list