View Full Version : secure anchor link in JSP

06-11-2008, 08:45 AM
I have a dynamic anchor link like http://mysite.com?flag=1&name='ganesh'
name query string changes every time.

This generated link i am sending by embedding it in to EMAIL Content.
Once u click on the link it will open details for that name.

Now the problem is that if i copy and paste the URL and change the name='someothername'. if it exists in my database it works. So How do i encode the query string .

How to add one more String as id="219837927398217" a random number to the query string.

06-20-2008, 02:47 PM
you have to use tokens to make sure that for a particular user only one specific url will work. the usual way is to generate a random number and store it in the database for that user for whom you are generating the link. and make sure that you validate the token for that user on whatever script that is getting called :)