acesar Posted May 26, 2011 Share Posted May 26, 2011 Hi Farshad, Can I keep a variable for the entire session? For example, I created a variable as class variable in MainModule, called AUser: ... ... TUniMainModule = class(TUniGUIMainModule) procedure UniGUIMainModuleCreate(Sender: TObject); private { Private declarations } public { Public declarations } AUser: string; end; ... ... Every time you refresh browser (IE, Opera, Firefox, Chrome, etc) MainModule is newly created, always changes UniApplication.UniSession.SessionID. UniApplication.UniSession.SessionID would not have to be maintained for the same connection? If UniApplication.UniSession.SessionID changes, I cannot put AUser variable in OnCreate event of MainModule (AUser := EmptyStr). Where can I put this variable so that its value persists throughout the session, That is, until the browser window is closed or the user run off from my system? Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted May 26, 2011 Administrators Share Posted May 26, 2011 Hi Farshad, Can I keep a variable for the entire session? For example, I created a variable as class variable in MainModule, called AUser: Hi, You can use a cookie. for this. See Cookie demo. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.