[Catalyst] optional login for some actions
Sai Tong
stong at fidelio.rutgers.edu
Mon Oct 3 21:20:20 CEST 2005
Wade.Stuart at fallon.com wrote:
>
>
>
>
>
>>How, if it is possible, to allow login optionally for accessing some
>>parts of the web application?
>>I created an action for simply displaying either one of two sets of
>>links of URL storing in a database, and I want
>>to allow users to access different results of the actions,to either
>>first sets of links or second sets of links,
>> based on whether or not the user logins (by using TT2 to post the
>>link if the user has a particular role ).
>>
>>
>>
>
>I am unable to tell from your post if this is an actual program logic issue
>or cache issue, from what I read it sounds more like cache.
>
>maybe take a look at http://www.perlmonks.org/index.pl?node_id=239698 (post
>showing a full out no cache setup) and verify that you are setting cache
>directives to force no caching on the sensitive pages? If this is a
>program logic issues can you please try to reword the question to be more
>specific, maybe with a real world example. If you need help with how to
>set such cache settings in your cat app let me know and I can get into more
>Cat specific details.
>
>
>
>
After seeing your response and researching for more relevant
information, I thinks this is more of a browser cache problem.
So for now in order to more correctly set the cache setting to force no
caching on the sensitive page, I am putting these lines
in the relevant actions of my cat application:
$c->res->headers->header('Expires' => '-1' );
$c->res->headers->header('Pragma' => 'no-cache' );
$c->res->headers->header('Cache-control' => 'no-cache,
no-store,must-revalidate, post-check=0, pre-check=0' )
Is it how one should to do for setting cache setting in the header of
pages generated by cat? Any one has any suggestion?
>>Which would work the way I want. However, if after I login and
>>logout with username that has the role for
>>accessing one (out of two) set of url link, and pass the back button
>>on the browser, the previous page
>>would show up from the browser's cache, which is not what I want to
>>
>>
>
>
>This is what is leading me to think it is a cache issue in entirety, as if
>the page cache settings were set to nocache the browser should not display
>the pervious page period.
>
>
>
>>happen. What I need is to force
>>this action to be reload every time when request of this action is
>>called from the browser, because if
>>I manually reload the action with the browser's reload button, the
>>result of this action with the correct link
>>will show up.
>>
>>Does anyone have any suggestion of how to accomplish this type of
>>option login mechanism?
>>
>>
>>
>>
>>_______________________________________________
>>Catalyst mailing list
>>Catalyst at lists.rawmode.org
>>http://lists.rawmode.org/mailman/listinfo/catalyst
>>
>>
>
>
>_______________________________________________
>Catalyst mailing list
>Catalyst at lists.rawmode.org
>http://lists.rawmode.org/mailman/listinfo/catalyst
>
>
More information about the Catalyst
mailing list