Page 1 of 1

Cookie loss

Posted: Sun Jul 30, 2006 6:30 pm
by fitchic77
feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


I'm already have these cookies set in a form and see their values:

Code: Select all

$jewel_condition = $_COOKIE['sellNow']['jewel_condition']; 
$metal = $_COOKIE['sellNow']['metal']; 
$price = $_COOKIE['sellNow']['price']; 
$description = $_COOKIE['sellNow']['description']; 
$active = $_COOKIE['sellNow']['active']; 
////////////////////////////////////////////////
$package_type = $_COOKIE['sellNow']['package_type']; 
$package_id = $_COOKIE['sellNow']['package_id']; 
$county = $_COOKIE['sellNow']['county']; 
$state = $_COOKIE['sellNow']['state']; 
$email = $_COOKIE['sellNow']['email']; 
$phone1 = $_COOKIE['sellNow']['phone1']; 
$phone2 = $_COOKIE['sellNow']['phone2']; 
////////////////////////////////////////////////
$jewelry_type = $_COOKIE['sellNow']['jewelry_type']; 
$size = $_COOKIE['sellNow']['size'];


Then I have to do some validation after the form processes (process.php)...if it fails, I have tested either way:

Code: Select all

header("Location: userReg.php?error=UE");
OR

Code: Select all

javascript: window.location ="userReg.php?error=UE";

I have several cookies like this set...I ONLY loose values in these and not any of the others. I'm stumped!! I can see them in the processing form(process.php), but as soon as I go back these are cleared out....and only these :?:

Code: Select all

$package_type = $_COOKIE['sellNow']['package_type']; 
$package_id = $_COOKIE['sellNow']['package_id']; 
$county = $_COOKIE['sellNow']['county']; 
$state = $_COOKIE['sellNow']['state']; 
$email = $_COOKIE['sellNow']['email']; 
$phone1 = $_COOKIE['sellNow']['phone1']; 
$phone2 = $_COOKIE['sellNow']['phone2'];

Any ideas would be GREATLY appreciated..


feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]

Posted: Sun Jul 30, 2006 6:35 pm
by feyd
I would imagine you're going beyond the size limits of the cookie that the browser allows. The maximum size is usually around 4K, I would consider an alternative storage medium, such as in a session.

Posted: Tue Aug 01, 2006 12:22 am
by fitchic77
I have also tried it with a session variable and it gets lost after I do the PHP header location or a javascript window.location.

The previous cookie example can't be a memory issue or it would fail to store all the other items.

SOLVED

Posted: Tue Aug 08, 2006 12:35 pm
by fitchic77
I was doing a redirect back to a page that had <HTML><head>etc...for some reason this whiped out the cookie and session information.

I just hardcoded the header.inc instead and all works great.