Ive only been doing PHP fer about a week, learnt a bit from various sources, one thing i havent learnt about tho is cookies...

What I want to do is use two scripts...

login.php
home.php

login script needs to set a cookie and home script needs to check for a cookie, if its there it produces home page with a small message sayong hello to that person if not, it goes to login script...

Now, I havent a clue how to go about this, so can anyone provide two or three code snippets on setting a cookie, checking for the same cookie and using the cookie to get info from that persons profile?

I have latest php version on the server, altho we have no mySQL, at the mo, it can be arranged. I'd prefer if I could use the cookie to pick things from a file like:

000001.cgi

Name
Pass
Hobbies

Almost exactly like ubb software if you know of it...

So say we set a cookie, it contains a member number.
I can then use that number to access a file and grab lines of info i may wish to use...

So say I have a file named 000001.cgi and it has the info:

Cheeko
Cheeko_Pass
Food

How would I set a cookie that remembers this persons member number (000001) and then how would I check if that cookie is set (home.php) and then how would I use that cookie to open file 00001.cgi and grab the info on line 3 about hobbies?

Or if not, where can I learn this?

Any help offered MUCH:Y appereciated!!