473,396 Members | 1,918 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

how to store an array in cookie

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
4 12409
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: dr. zoidberg | last post by:
Is it possible to put Variable in Array? Here is what I need: $array = Array($a,$b); $a = 'something'; $b = 'something else'; foreach ($array as $val) { echo "$val"; }
4
by: David Gray | last post by:
Greetings all, I need to sort an array containing text only values and remove duplicates at the same time. I was thinking of... 1. Loading all values into one array (Array1) 2. Read...
3
by: Francois | last post by:
Is it possible to automatically create an array on load page? I want my script to be external. (<script language="JavaScript" src="somescript.js"></script>) Several pages should use this...
4
by: Ziggy | last post by:
The purpose of my application is to require a website visitor to complete a form before participating in a search application. I have a specific reason for doing this with client-side javascript,...
3
by: James Geurts | last post by:
This is probably more of an ASP.Net situation rather than c#, but since all of my code behind is in c#, maybe it fits here. I'm wondering, generally, at what point is it too inefficient to store...
3
by: Martin | last post by:
Dear fellow ASP.NET programmer, I stared using forms authentication and temporarily used a <credentials> tag in web.config. After I got it working I realized this wasn't really practical. I...
3
by: Tillman Erb | last post by:
Let's assume a database with a parent table and a child table in a one-to-many relationship, respectively. I have a DataList control on page P that displays values from the parent table. Each row...
7
by: monomaniac21 | last post by:
hi i have a php site which allows users to save a cookie on their computer which stores their user id details and allows them to auto- login. i'm wondering whether this is safe, is it...
8
by: pim | last post by:
Dear All, What I was wondering is how safe it is to store user_id or username or anything like that in session. I usualy store a bunch of info in a session so I do not need to search the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.