base64_encode is not secure at all, it's not encryption, and it shouldn't be used to store usernames and passwords.
anyone using that computer could easily look at all teh cookies on your computer and get your username and password from them.
the safe option would be to store a cookie witha unique ID signed to it, then store the unique ID in the 'user' table ( if you're using mysql ) or a text file.
your table, or data, could look like this:
ID, username, password (md5 hashed), unique_ID, Date_expire
1, KeithP, 5f4dcc3b5aa765d61d8327deb882cf99, asd8976as987gasdg, 2003-03-17
Then, check first if theres a cookie set, next check if the cookies value is equal to a unique_ID in the database, and check if the Date_expire > NOW()