Problem with cookies

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
blira
Forum Newbie
Posts: 4
Joined: Sun Oct 28, 2007 5:55 pm

Problem with cookies

Post by blira »

Hi all.

Here is my problem:

Page: login.php

Code: Select all

<head>
...
$cookie_data=$user."-".$pass."-".$role;
if(setcookie ("FLEISCHMANN_ADMIN",$cookie_data, $time+3600)==TRUE)
...
//Note $user, $pass, $role DO have data
</head>
Page: logged.php (once the login succeeds)

Code: Select all

<head>
...
$cook = explode("-", $_COOKIE['FLEISCHMANN_ADMIN']);	
$namecookie = $cook[0];
$passcookie = $cook[1];
$rolecookie = $cook[2];
...
</head>
$cook is empty and no cookie data is read... I've run out of ideas. Please help!

Thanks
Bernardo
Post Reply