[thelist] asp, cookies and javascript

Mike Stenhouse Mike.Stenhouse at spiritsoft.com
Mon Jan 13 19:14:02 CST 2003


--
[ Picked text/plain from multipart/alternative ]
Hi all

I'm trying out cookies (asp using server-side javascript) for the first
time and I have a problem that's driving me mad... I'm trying to store
some data from a form in a set of cookies and then pull the whole lot
out (cookie name and value) for display elsewhere. I can loop through
the cookie collection writing out the values using the following code
but I can't seem to find any way of getting the name:

for(var i=1; i<Request.Cookies.Count+1; i++){
    Response.write(Request.Cookies(i) + "<br />")
}

I've tried the obvious Request.Cookies(i).Name but to no avail. I've
been able to get the cookie names out using an enumerator but then I
can't get the associated value:

var e = new Enumerator (Request.Cookies);
while ( !e.atEnd()) {
    Response.write(e.item()+"<br />");
    e.moveNext ( );
}

All the examples are in VBScript which I'm not too hot on. This must be
easy but I just can't find a way of doing it!!!

Thanks in advance

Mike


This message contains confidential information and is intended only for the named individual and may not be disseminated without prior permission.  If you are not the named addressee, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this message in error and delete this e-message from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, delayed in transmission, incomplete, or may contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this Message which arise as a result of e-mail transmission.  If verification is required please request a hard-copy version. This message is provided for informational purposes and should not be construed as a solicitation or offer to buy or sell any software or services.

________________________________________________________________________
This email has been scanned for all viruses by the MessageLabs SkyScan
service. http://www.messagelabs.com
________________________________________________________________________



More information about the thelist mailing list