Main
Index
Search
Posts
Who's
Online
Log
In

Home: Discontinued/Classic Products: Article Manager 1:
cookie oddities in search engine

 

 


ccho
User

Jul 11, 2002, 2:08 PM

Post #1 of 2 (2054 views)
Shortcut
cookie oddities in search engine Can't Post

I'm guessing that Article Manager uses some temporary cookie when a search is submitted, because I am able to read a cookie value, "administrator", which happens to be my username for Article Manager. In Javascript, I have a function to read the values of a specified cookie (I store 2 cookies for this website, USERNAME and SESSION_ID).


Code
 function readCookie(i) {  
if (document.cookie) {
var myCookie = unescape(document.cookie);
var spCookie = myCookie.split("; ");
var values = spCookie.split("=");

return values[1];

}
else {
return;
}
}




Whenever I complete a search, it gives me "administrator" rather than the USERNAME value that is in the cookie. All other pages work fine however. Other than not including this information, is there any way to work around this? Is there a cookie being set?

Chris Cho
Welchintegrated.com, Inc.


Just a little addendum here, I was able to read all sorts of other parameters that were supposed to be sent to the search when reading document.cookie. I guess it might just be best to leave reading my cookies out of the search results page.



(This post was edited by ccho on Jul 11, 2002, 2:16 PM)


Chris
Staff


Jul 12, 2002, 5:42 PM

Post #2 of 2 (2041 views)
Shortcut
Re: [ccho] cookie oddities in search engine [In reply to] Can't Post

Hi Chris,

Although Article Manager's control panel (admin.cgi) does use cookies to keep track of your login information, the search engine doesn't use cookies at all. However, the cookies set by admin.cgi should definately be accessible to search.cgi, because both programs are in the same directory.

Now, I'm no JavaScript expert, but it seems to me that your readCookie() function has been hard-coded to deal with just one cookie. It may be returning the value of the "id" cookie, set by admin.cgi, which would be your username (ie. "administrator"). You should try rewriting your JavaScript function to support multiple cookies, so that it'll be compatible with visitors taht have more cookies than you're expecting.

There are a bunch of free getCookie() routines available, and a quick search on google.com for javascript getcookie split should reveal them.

If this doesn't help, let me know and I'll look into the issue further.
Chris