I have a situation where I need to keep some data in a class structure throughout my application and this data differs for every user.
What I tried is :
I created a class structure and instantiated in one JS remoting call and tried accessing it in another remoting call but I was unsuccessful in fetching the data.
My Code :
public class MyInstance{
public static string myData;
}
@RemoteAction
public static string setuserData(){
MyInstance.myData = 'MyName';
}
@RemoteAction
public static string getuserData(){
return MyInstance.myData;
}
When I call getUserData after setUserData I get null.
Please help me out, how I can achieve what I want here.