Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old March 26th, 2008, 10:35 AM
jacusp@poczta.onet.pl
Guest
 
Posts: n/a
Default Reading cookies problem

Hi,

I have problem with reading cookies.
I'd like to save fields of my form into cookies and use them by
another page.
I save cookies:
foreach ($_POST as $idx =$value)
{
setcookie($idx, $value);
}
I check them in FireFox, all cookes are set OK.

Then I'd like to read them using code:
foreach( $_COOKIE as $key =$var )
{
print $key . ": " .$var . "<br>";
}

I save about 60 cookies, unfortunatley only some cookies are read!
I have no idea what's wrong.
Please help me to solve my problem.

Thanks in advance for a help!
Regards,
Jacek

  #2  
Old March 26th, 2008, 10:35 AM
petersprc
Guest
 
Posts: n/a
Default Re: Reading cookies problem

You might be running into the limit on the amount of cookie data sent
per site in that browser.

You may be able to store some of these values in the session instead.
You can tweak the session cookie parameters with
session_set_cookie_params.

You could also just insert the data into a db and set a cookie
containing a unique ID that references the data.

Regards,

John Peters

On Mar 26, 5:25 am, "jac...@poczta.onet.pl" <jac...@poczta.onet.pl>
wrote:
Quote:
Hi,
>
I have problem with reading cookies.
I'd like to save fields of my form into cookies and use them by
another page.
I save cookies:
foreach ($_POST as $idx =$value)
{
setcookie($idx, $value);}
>
I check them in FireFox, all cookes are set OK.
>
Then I'd like to read them using code:
foreach( $_COOKIE as $key =$var )
{
print $key . ": " .$var . "<br>";
>
}
>
I save about 60 cookies, unfortunatley only some cookies are read!
I have no idea what's wrong.
Please help me to solve my problem.
>
Thanks in advance for a help!
Regards,
Jacek
  #3  
Old March 26th, 2008, 01:55 PM
jacusp@poczta.onet.pl
Guest
 
Posts: n/a
Default Re: Reading cookies problem

Hi,

but I can see in my browser that cookies are set OK, so why the limit
on the amount of cookie data sent is not OK?
I don't get it...

Reagards,
Jacek

On 26 Mar, 10:34, petersprc <peters...@gmail.comwrote:
Quote:
You might be running into the limit on the amount of cookie data sent
per site in that browser.
>
You may be able to store some of these values in the session instead.
You can tweak the session cookie parameters with
session_set_cookie_params.
>
You could also just insert the data into a db and set a cookie
containing a unique ID that references the data.
>
Regards,
>
John Peters
>
On Mar 26, 5:25 am, "jac...@poczta.onet.pl" <jac...@poczta.onet.pl>
wrote:
>
>
>
Quote:
Hi,
>
Quote:
I have problem with reading cookies.
I'd like to save fields of my form into cookies and use them by
another page.
I save cookies:
foreach ($_POST as $idx =$value)
{
* *setcookie($idx, $value);}
>
Quote:
I check them in FireFox, all cookes are set OK.
>
Quote:
Then I'd like to read them using code:
foreach( $_COOKIE as $key =$var )
{
* *print $key . ": " .$var . "<br>";
>
Quote:
}
>
Quote:
I save about 60 cookies, unfortunatley only some cookies are read!
I have no idea what's wrong.
Please help me to solve my problem.
>
Quote:
Thanks in advance for a help!
Regards,
Jacek- Ukryj cytowany tekst -
>
- Pokaż cytowany tekst -
  #4  
Old March 26th, 2008, 02:15 PM
Willem Bogaerts
Guest
 
Posts: n/a
Default Re: Reading cookies problem

Hi,
Quote:
>
but I can see in my browser that cookies are set OK, so why the limit
on the amount of cookie data sent is not OK?
I don't get it...
That limit is perfectly OK, as you will have noticed. Cookies are not
meant to store enormous amounts of data. That is why your browser puts a
limit on it. Just don't store 60 (!) cookies on a client computer. Store
just one and keep the data at the server.

Good luck,
--
Willem Bogaerts

Application smith
Kratz B.V.
http://www.kratz.nl/
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles