Yes, you could use a server side scripting language such as php or asp to manage the cookie/session. The code would be very similar in logic to the javascript you use now. However, all the calculations would be done server side, so the scripts preformance is not affected by the clients system.