Grokbase
Topics Posts Groups | in
x
[ help ]

Re: [Catalyst] Subsessions?

View PostFlat  Thread  Threaded | < Prev - Next >
Yuval Kogman Re: [Catalyst] Subsessions?
| +1 vote
[ Profile | Reply to group ] [ Flat  Thread  Threaded ]
A somewhat naive idea:

sub session {
my $c = shift;

if ( my $sub = $self->subsession_id ) {
  return $self->NEXT::session->{$sub} ||= {};
} else {
  $self->NEXT::session(@_);
}
}

subsession_id can be some param I suppose like in State::URI. You
can probably subclass State::URI to make it so that it doesn't plug
into the session system, but instead goes to subsession_id, or just
keep track of it manually.

Cheers,


On Thu, Sep 27, 2007 at 12:11:47 +0200, Rainer Clasen wrote:
> Hello,
>
> there are currently two Problems I could easily solve with subsessions.
>
> After saving some data I want to redirect the user back to where he came.
> So I'd like to keep track where the user came from. As I expect the User
> to use several Browser windows, neither Cookie based Sessions (incl.
> stash) work in all scenarios. Right now I'm using the HTTP Referer, which
> I'm also considering a bit clumsy.
>
> Furtermore there are users who have access to other users' data. I'd like
> them to select them *once* which user's data they want to work on and keep
> this for the current browser window. Again I expect the user to use
> multiple browser windows (say for working with multiple users' data at the
> same time).
>
> So I'm searching for something functional similar to:
> http://paneris.net/cgi-bin/cvsweb.cgi/SubSession/SubSessions.html?rev=1.3
>
> I've had no luck finding something similar for Catalyst. Well,
> Catalyst::Plugin::Session::State::URI gives me some Ideas on how I could
> implement this, but if possible I'd prefer to avoid re-inventing the
> wheel (especially as I expect this to be non-trivial).
>
> Rainer
>
> --
> KeyID=759975BD fingerprint=887A 4BE3 6AB7 EE3C 4AE0 B0E1 0556 E25A 7599 75BD
>
> _______________________________________________
> List: [email protected: Cat...@lists.rawmode.org]
> Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
> Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
> Dev site: http://dev.catalyst.perl.org/

--
  Yuval Kogman <nothingmuch@woobling.org>
http://nothingmuch.woobling.org 0xEBD27418


_______________________________________________
List: [email protected: Cat...@lists.rawmode.org]
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/

Thread : [Catalyst] Subsessions?
1)
Rainer Clasen Hello, there are currently two Problems I could easily solve with subsessions. After saving some...
2)
Yuval Kogman A somewhat naive idea: sub session { my $c = shift; if ( my $sub = $self->subsession_id ) { return...
3)
Rainer Clasen Thanks to both of you. Your responses helped a lot to sort my Ideas and hack up my initial "poor...
paperclip
4)
Zbigniew Lukasiak Interesting. I usually use GET parameters for that - but I can imagine where it would become not...
5)
A. Pagaltzis You’re asking the wrong question. Sessions are a bad idea in general; application state should...
6)
Yuval Kogman For what it's worth, I agree. Sessions are like a half assed model with automagical fetching of the...
7)
Rainer Clasen I also consider "normal" sessions evil. My subsessions are still ugly, but at least they keep the...
spacer
View PostFlat  Thread  Threaded | < Prev - Next >