Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Arrays & Cookies

Status
Not open for further replies.

DigitalBoy

Programmer
Oct 11, 2000
87
US
Has anyone written a cookie that simply adds to an array? In other words, a cookie that, upon some sort of action, would just add a variable to a list of other variables and on another page print those variables to the document object? I have a similar requirement and I was wondering if anyone else had any success with this.

- DB

dgtlby@excite.com
Administrator

UBB Developers Network

 
I'm thinking that the following might be a possible solution:

1) A button is pressed on page_x.html calling function
doSomething().
2) doSomething checks the total number of cookies that are
currently in existance.
3) If the total number is greater than five, then
doSomething() is aborted.
4) If the total number is less than five, doSomething()
writes a cookie. Obviously some sort of dynamic array
would have to be involved here.
5) When page_y.html is launched onLoad is called to check
for cookies.
6) if cookies exist, then their values are written to the
document.

Since I've never written a cookie quite like this, I'm not sure how to approach this.

- DB

dgtlby@excite.com
Administrator

UBB Developers Network

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top