By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,826 Members | 1,338 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,826 IT Pros & Developers. It's quick & easy.

how to store an array in cookie

P: n/a
Hi All,

In my application, I have a page, which displays a number of
rows, and each row having a check box . I can check more than one
check box on this page and I have to store all these check box values
on a single cookie . Like if I am storing some ids as the values for
the check boxes ,then I have to put all thesee ids of the checkboxes
into a single cookie , which are checked .

Please help me.

Thanks
amar

Jan 29 '07 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Amar schreef:
Hi All,

In my application, I have a page, which displays a number of
rows, and each row having a check box . I can check more than one
check box on this page and I have to store all these check box values
on a single cookie . Like if I am storing some ids as the values for
the check boxes ,then I have to put all thesee ids of the checkboxes
into a single cookie , which are checked .

Please help me.

Thanks
amar
Why cookies ? They are unreliable. Use sessions (or a database if you
need to store them for a longer time).
--
Arjen
http://www.hondenpage.com
Jan 29 '07 #2

P: n/a
On 29 Jan 2007 03:39:37 -0800, "Amar" <gh**********@gmail.comwrote:
>Hi All,

In my application, I have a page, which displays a number of
rows, and each row having a check box . I can check more than one
check box on this page and I have to store all these check box values
on a single cookie . Like if I am storing some ids as the values for
the check boxes ,then I have to put all thesee ids of the checkboxes
into a single cookie , which are checked .

Please help me.

Thanks
amar
http://us2.php.net/serialize
Jan 29 '07 #3

P: n/a
Arjen wrote:
Amar schreef:
>Hi All,

In my application, I have a page, which displays a number of
rows, and each row having a check box . I can check more than one
check box on this page and I have to store all these check box values
on a single cookie . Like if I am storing some ids as the values for
the check boxes ,then I have to put all thesee ids of the checkboxes
into a single cookie , which are checked .

Please help me.

Thanks
amar

Why cookies ? They are unreliable. Use sessions (or a database if you
need to store them for a longer time).

Arjen: how do you think your server knows which session the request is
associated with.

Amar:
Cookies are (at least) as reliable as sessions - the problem is ITS THE
WRONG PLACE TO KEEP POLYMORPHIC USER DATA STRUCTURES.

If you must, try using a bitfield. But don't I didn't warn you when it blows
up in your face.

C.
Jan 29 '07 #4

P: n/a
Colin McKinnon schreef:
Arjen wrote:
>Amar schreef:
>>Hi All,

In my application, I have a page, which displays a number of
rows, and each row having a check box . I can check more than one
check box on this page and I have to store all these check box values
on a single cookie . Like if I am storing some ids as the values for
the check boxes ,then I have to put all thesee ids of the checkboxes
into a single cookie , which are checked .

Please help me.

Thanks
amar
Why cookies ? They are unreliable. Use sessions (or a database if you
need to store them for a longer time).


Arjen: how do you think your server knows which session the request is
associated with.
RTFM :-D
A visitor accessing your web site is assigned an unique id, the
so-called session id. This is either stored in a cookie on the user side
or is propagated in the URL.

Some of the cookies (atleas in older browsers) fail. Cookies are not
reliable.

--
Arjen
http://www.hondenpage.com - Mijn site over honden
Jan 30 '07 #5

This discussion thread is closed

Replies have been disabled for this discussion.