PDA

View Full Version : Using cookies to check username and password


Jeepers
08-08-2003, 12:47 PM
Hi all

I've been avoiding this for about a year as I don't understand it at all.

A user will enter their username and password, it will then be checked against a database stored on the server, if correct then continue else ask again or create new user etc. That is no problem.

I also want to check if they have logged on before, if so then check the details held in a cookie against the database and continue if found else ask for login details etc.

I assume all the storing of their username and password will be done by cookies on the client computer. Could someone please give me an idea of how to create, query and act upon the cookies. I really have no idea so not too technical please.

Thanks alot.

Nightfire
08-08-2003, 01:00 PM
what language are you using?

Jeepers
08-08-2003, 01:20 PM
The database will be a flat text file that will be checked via a perl script. That part is no problem. What I need to know is how to create, query and transfer the details of the cookie to the script (by a form I thought, but don't know) so that I can get the script to do the checking.

Vladdy
08-08-2003, 01:33 PM
Cookie information is sent with HTTP request - it's all server side.

Nightfire
08-08-2003, 02:01 PM
I never got as far as cookies when I learnt a bit of perl, but this may help you http://perl.about.com/library/weekly/aa031400a.htm

Jeepers
08-08-2003, 02:41 PM
Thanks Nightfire for the link. :thumbsup: I'll give it a go and see what happens. I now realise that I have posted this in the wrong forum, whoops, sorry. :eek: