[pmwiki-users] Cookies and links
DaveG
pmwiki at solidgone.com
Wed Feb 17 16:37:45 CST 2010
On 2/17/2010 3:53 PM, pmwiki at 911networks.com wrote:
> Hi,
>
> I'm trying to restrict some download action. I email yesterday. I was
> looking into the cookies for validation. I have looked at
> httpvariables but...
>
> 1. How can I assign a cookie value when people click on an external
> link?
You'd need to hook into the javascript click event, and log the cookie
from javascript. However, unless you tie the cookie to some form of
token/id on the server-side, you should not rely on the presence/value
of a cookie for anything which needs to be secure.
> 2. How do I display conditionally on another page, an image or a text
> based on the value of the cookie?
Again, use javascript to read the value of the cookie, and set the image
src to whatever image you want.
~ ~ Dave
More information about the pmwiki-users
mailing list