it's late here and i'm too tired to understand what you meant to do, so i'll be generic.
i expect you are using version 2.3
saving by server on server: use scripting command {.save.}
by server on browser: use scripting command {.cookie.}
by browser on browser: google for javascript cookie writing
by browser on server: you should use a form, or ajax.
if you need an ajax example you can refer to the default template, it uses this technique.
for scripting commands documentation refer to
www.rejetto.com/wiki