Question about velocity: using VelocityView
Greg Haverkamp
gahaverkamp at lbl.gov
Fri Oct 14 13:40:36 EDT 2016
At the risk of oversimplifying... It reads to me like you only want to read
the cookies? (It wasn't clear to me how you planned to set them.) Cookies
are in the request:
#set ($cookies = $request.getCookies())
>From there, you can grab the cookie you're looking for and act on it.
Greg
On Wed, Oct 12, 2016 at 10:55 AM, Karla Borecky <kborecky at smith.edu> wrote:
> Thank you, Scott. That sounds like the way to go! I figured there must be
> something reading cookies built into the code, since that's an important
> component, but I didn't think I could use it. (And, no, I really really
> don't want to go off the standard-install-IdP grid.) It's very probably
> over my head. O_o But, have Test IdP, will travel.
>
> Basically, I'm afraid if I have the cookie name visible - say, in
> javascript - then the <very rude word>s who have already screen grabbed my
> login image to try to trap people will be able to see the cookie name for
> the personal image, and display THAT, too, making their trap look even more
> authentic. I HATE THEM. Just saying.
>
> On Wed, Oct 12, 2016 at 1:13 PM, Cantor, Scott <cantor.2 at osu.edu> wrote:
>
>> > I would potentially like to be able to access cookie values in my
>> login.vm, and
>> > it looks like the CookieTool (org.apache.velocity.tools.vie
>> w.tools.CookieTool)
>> > would be the easiest way to do this.
>>
>> I don't know anything about the toolbox stuff at all, I'm afraid. My
>> advice for general reasons of portability is to avoid it for things you can
>> do other ways.
>>
>> > In the end, what I'm looking into doing is display a personalized image
>> and
>> > phrase for the user based on cookie values - but I don't want the cookie
>> > names to be visible (as it would be if you used javascript to do this.)
>>
>> Leaving aside the "how", I'm not sure why that matters. The name is not
>> secret to the user if that's what you're thinking.
>>
>> In terms of "how", we have a class called CookieManager that we use in
>> the IdP and I've used it for this kind of thing in my views. There's a bean
>> for managing per-session cookies and one for persistent cookies, and
>> usually my use cases fit one of the two well enough that I don't need my
>> own.
>>
>> The custom object support in our views means you can inject a reference
>> to shibboleth.PersistentCookieManager and use it.
>>
>> -- Scott
>>
>> --
>> To unsubscribe from this list send an email to
>> users-unsubscribe at shibboleth.net
>>
>
>
>
> --
> Karla Borecky
> Systems Administrator
> ITS
> Smith College
> Northampton, MA 01063
>
> --
> To unsubscribe from this list send an email to
> users-unsubscribe at shibboleth.net
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://shibboleth.net/pipermail/users/attachments/20161014/7ab1c143/attachment.html>
More information about the users
mailing list