PDA

View Full Version : Can cookies toolkit protect one single page?


i.edwards384429
02-28-2010, 01:49 AM
Hi

do doubt silly question but can I use cookies toolokit to protect one single page?

What I want is to be able to give a specific user a username and password so that they are the only ones able to view that page , however I dont want to have to setup a database. In the past I've used a java applet, just wondered it cookies would do it?

thanks

Ian

Eric Mittman
03-01-2010, 10:50 AM
There are a couple ways you can do this but I think it would be best to have a server side check on the user trying to login.

The page should have a login form, the user will enter their details and submit. You can then check on the posted values to ensure that they match the correct username and password for that page.

You could take a a step further by storing the username and password in cookies, then when the user comes to that page check the cookies first to try and auto login them in. If the cookies match the correct username and password then they should be automatically logged in.

This is all very custom though and will require you to implement this code by hand.