Question about velocity: using VelocityView

Cantor, Scott cantor.2 at osu.edu
Wed Oct 12 13:13:43 EDT 2016


> 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.view.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



More information about the users mailing list