FAQ
Hi Folks:

Here is what I want to do. I want to preserve values of stuff across
the life of a session, without having to jump through hoops to do it. I
want it to survive redirects in the app. It would be nice if it were
just like stash.

Really, it is very simple. And I thought I had it.

$c->flash

as part of C::P::Sessions, C::P::Sessions::Store::FastMmap and
C::P::Sessions::State::Cookie says it preserves state across redirects.
You have to touch the values at each instance (and since this is in
the middle of a bunch of forms that might be suspect).

Unfortunately, I am noticing lots of dropouts of state. Values go
missing and all that. The session ids are preserved. The state is not.

Rather than jamming this all into a cookie, I would like a server
side version that "just works". I am awful close to using a
quick-n-dirty DB for this explicitly, using the session_id as a key.

I am assuming it is massive pilot error on my part, but I am having
trouble finding it. I get the same behavior with
C::P::Sessions::Store::File as I do with FastMmap. Any thoughts? Is
the state working perfectly for others? If so, are you using FastMmap?
Are you using Cache?

Finally as an RFE for 5.8, it would be really, really nice if there
was a $c->sessionstash that worked just like stash. Stash is great,
things that work like stash are great.

--
Joe Landman
landman@scalableinformatics.com

Search Discussions

  • Andrew Rodland at Nov 7, 2007 at 3:59 am

    On Tuesday 06 November 2007 09:40:01 pm Joe Landman wrote:
    Hi Folks:

    Here is what I want to do. I want to preserve values of stuff across
    the life of a session, without having to jump through hoops to do it. I
    want it to survive redirects in the app. It would be nice if it were
    just like stash.

    Really, it is very simple. And I thought I had it.

    $c->flash
    [...]
    Finally as an RFE for 5.8, it would be really, really nice if there
    was a $c->sessionstash that worked just like stash. Stash is great,
    things that work like stash are great.

    There is. It's called "session". Flash works like session except that stuff
    disappears after the first time you read it -- thus the mysterious "data
    dropouts".

    Andrew
  • Joe Landman at Nov 7, 2007 at 4:04 am

    Andrew Rodland wrote:

    There is. It's called "session". Flash works like session except that stuff
    disappears after the first time you read it -- thus the mysterious "data
    dropouts".
    Ok. I may have conflated session and stash in my reading (drew an
    equivalence between the two).

    Quite possibly an Emily Litella
    (http://en.wikipedia.org/wiki/Emily_Litella) moment on my part ...

    Thanks.

    --
    Joe Landman
    landman@scalableinformatics.com
  • Joe Landman at Nov 7, 2007 at 4:07 am

    There is. It's called "session". Flash works like session except that stuff
    disappears after the first time you read it -- thus the mysterious "data
    dropouts".
    Yup. Pilot error. s/flash/session/g works the way I want. Thanks.

    --
    Joe Landman
    landman@scalableinformatics.com
  • Jonathan Rockway at Nov 7, 2007 at 4:17 am

    Joe Landman wrote:
    There is. It's called "session". Flash works like session except that
    stuff disappears after the first time you read it -- thus the
    mysterious "data dropouts".
    Yup. Pilot error. s/flash/session/g works the way I want. Thanks.
    Just out of curiosity, what documentation lead you in this direction?
    flash doesn't get much mention officially, I don't think.

    Regards,
    Jonathan Rockway

    -------------- next part --------------
    A non-text attachment was scrubbed...
    Name: signature.asc
    Type: application/pgp-signature
    Size: 370 bytes
    Desc: OpenPGP digital signature
    Url : http://lists.scsys.co.uk/pipermail/catalyst/attachments/20071106/85811d41/signature.pgp
  • Joe Landman at Nov 7, 2007 at 4:25 am

    Jonathan Rockway wrote:

    Just out of curiosity, what documentation lead you in this direction?
    flash doesn't get much mention officially, I don't think.
    http://search.cpan.org/~nuffin/Catalyst-Plugin-Session-0.19/lib/Catalyst/Plugin/Session.pm

    For some reason, session didn't work the first time I played with it.

    It is behaving nicely now. So I read the rest of the documentation, and
    there, right under sessions is a little discussion on flash ...

    ... to my fevered brain, it seemed like "approximately" what I wanted to do.

    --
    Joe Landman
    landman@scalableinformatics.com
  • Peter Karman at Nov 7, 2007 at 4:01 am

    Joe Landman wrote on 11/6/07 9:40 PM:
    Hi Folks:

    Here is what I want to do. I want to preserve values of stuff across
    the life of a session, without having to jump through hoops to do it. I
    want it to survive redirects in the app. It would be nice if it were
    just like stash.

    Really, it is very simple. And I thought I had it.

    $c->flash

    $c->session


    That does what you describe.

    --
    Peter Karman . http://peknet.com/ . peter@peknet.com

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcatalyst @
categoriescatalyst, perl
postedNov 7, '07 at 3:39a
activeNov 7, '07 at 4:25a
posts7
users4
websitecatalystframework.org
irc#catalyst

People

Translate

site design / logo © 2021 Grokbase