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?