[Catalyst] how to do persistent session data (aka shopping cart) in catalyst?

Fernan Aguero fernan.aguero at gmail.com
Thu Apr 26 16:47:54 GMT 2018


Thanks for all the responses.

So, it's just a matter of using standard Catalyst::Plugin:Session, and
maybe also Catalyst::Plugin::Session::Store::DBIC and then write some
business logic to either use the session_data from the sessions table
(anonymous user) or the session_data from the users table (logged in user)?
I'd appreciate if you can share more details on the implementations
(plugins you use/recommend?)

I'm asking because we used to have an old catalyst app relying on
Catalyst-Plugin-Session-PerUser for this, but it's currently broken. It
used to work well with the older (deprecated) Authentication::Store::DBIC,
but switching to the current Catalyst-Authentication-Store-DBIx-Class
breaks it.

Anyway, I assume that so far, with the info we have, we will have to
rewrite the logic within Catalyst-Plugin-Session-PerUser in our app.

Cheers,

--
fernan

On Thu, Apr 26, 2018 at 11:54 AM, Hector Azpurua <h3ct0r.ml at gmail.com>
wrote:

> Hi Fernan,
>
> The I did for a small/medium size enterprise it was:
>
>    - Cart data is stored at DB level, so the information can be
>    replicated among all devices and browsers sessions.
>    - If an Anonymous user has cart data and then log in, then merge
>    previous stored cart with the new cart (business rules apply here).
>
> It wasn't difficult to implement using the already available catalyst
> plugins and, if needed, JSON serialization.
>
> Good luck!
>
>
> 2018-04-26 11:31 GMT-03:00 Fernan Aguero <fernan.aguero at gmail.com>:
>
>> Hello,
>>
>> what is the current recommended way of developing a persistent
>> shopping-cart-style functionality in a catalyst app?
>>
>> We would like to be able to support the following:
>> i) store session data in the server for logged in users
>> ii) keep session data across sessions, and across browsers (e.g. computer
>> at home, resume session using computer at work)
>> iii) allow users to start working anonymously, then merge session data
>> (shopping cart) smartly upon logging in
>>
>> Thanks for any pointer. Cheers,
>>
>> --
>> fernan
>>
>> _______________________________________________
>> List: Catalyst at lists.scsys.co.uk
>> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
>> Searchable archive: http://www.mail-archive.com/ca
>> talyst at lists.scsys.co.uk/
>> Dev site: http://dev.catalyst.perl.org/
>>
>>
>
> _______________________________________________
> List: Catalyst at lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive: http://www.mail-archive.com/
> catalyst at lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/
>
>


-- 
fernan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.scsys.co.uk/pipermail/catalyst/attachments/20180426/eff83d45/attachment.htm>


More information about the Catalyst mailing list