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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

storing window handle (object reference) in cookie

Status
Not open for further replies.

whiteyboy

Programmer
May 1, 2001
1
GB
I am trying to store the object reference to a window in a cookie to allow persistance throughout my site. I assign the objref to a var and set the cookie correctly but the cookie shows [object] rather than a reference to the object. As a result any subsequnt call to my window based on the cookie value fails as it doesn't actually have the object reference.

How do I convert the Object reference so that it can be stored in the cookie correctly. I have enclosed what I am currently doing to set the value below (obviously I am not actually using "etc" and am setting the expiry and domain):

var windowHandle = window.open(url,"etc","etc");

SetCookie('helpHandle',windowHandle,largeExpDate,myDomain);

Any help would be much appreciated, I have trawled the web to no avail,



Leigh

 

try putting the variable of the window, (windowHandle) in quotes instead of just the variable name. i think you're calling the value of windowHandle, which is the window.open object...

if that doesn't work, try putting the name of the window, (the first "etc"...) and reference it that way...

or...post your code. my cookie experience is small, so i'm guessing. but if you post all the code, someone can test it out...

good?

- spewn
 
A cookie is pure text, so it has been assigned it's value incorrectly, you may have tried to assign the actual object, meaning it's text representaion -[object] was stored.

About the only thing you can try is to store the name of the window and target that.

I think I have tried this before - but it did not work, but give it a go anyway, I did not do a thorough test.

<bb/>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top