will trillich wrote on 11/29/2010 05:37 PM: > Aha! It looks like a sneaky, evil, wrong, mean, horrid way to > switch-user in the middle of a session is to > > $c->session->{__user}{id} = $new_id_here; # since "id" = PK > > But that's undoubtedly bad form of the worst kind. > > What's the canonical non-sneaky above-board friendly golden way to do this? >
I don't know that there is a canonical way. This is Perl. As I mentioned in my reply to this thread in July[0], one way is to login as the new user and store the original username in the new user's session. That way the app knows that the new user is allowed to revert to the original user, but otherwise the app treats the current session just as it would if the new user had logged in normally. [0] http://www.mail-archive.com/catalyst@lists.scsys.co.uk/msg09968.html -- Peter Karman . http://peknet.com/ . pe...@peknet.com _______________________________________________ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/