can you please explain your requirement bit more as you have not mentioned location like where you want global variable, in YUI,freemarker,java,alfresco javascript etc…I guess the thing , which you want , as per my understanding , is not possible.you need to create one node inside alfresco and access that node by users.so by this way it will become possible.