Go4Expert

Go4Expert (http://www.go4expert.com/)
-   Java (http://www.go4expert.com/forums/java/)
-   -   new to java, need help with this code to set cookie (http://www.go4expert.com/forums/java-help-code-set-cookie-t22335/)

Taurus MFF 7Jun2010 05:06

new to java, need help with this code to set cookie
 
we had a feature to be able to open/close a block of text on our site. the user's selection (expand or collapse) gets stored in a cookie.

we have since removed the feature to open/close the block. the problem is that anyone who had the block closed before we removed the open/close feature does not see the block.

we need to replace the existing cookie and set the new cookie to contain the correct value to open (expand) the block.

following is the part of code which set the original cookie. how do I modify this to expire the existing cookie and set the new one to expand the block? do I just set var A=1 and change the getTime()+ statement?
var A=fetch_cookie("vbulletin_sidebar_collapse");if(A= ="1"){this.collapse(false)}};vBSidebar.prototype.t oggle_collapse=function(A){YAHOO.util.Event.stopEv ent(A);if(YAHOO.util.Dom.getStyle(this.sidebar,"di splay")=="none"){this.expand()}else{this.collapse( true)}return false};vBSidebar.prototype.collapse=function(A)

...........

{expires=new Date();expires.setTime(expires.getTime()+(1000*864 00*365));set_cookie("vbulletin_sidebar_collapse",A ,expires)};
thank you for your help!


All times are GMT +5.5. The time now is 11:59.