Fotiman - 11:48 pm on May 28, 2012 (gmt 0)
toGMTString is deprecated and should not be used. Use toUTCString instead.
Instead of setDate, use setTime:
exdate.setTime(exdate.getTime() + (1000 * 60 * 60 * 24 * expiredays));
setTime takes a value in ms, and getTime returns a value in ms. So get the current time in ms, then multiply your expiredays value by 24 to get the number of hours, multiply that by 60 to get the number of minutes, multiply that by 60 to get the number of seconds, and multiply that by 1000 to get the number of ms. Then, as I mentioned, use toUTCString instead of toGMTString.
Hope that helps.