Alex B. Posted April 20, 2023 Share Posted April 20, 2023 In my project, I have a login screen, where the user enters the login and password, I use this information to query the database. When the query returns a record, I assign the value of the record's ID to a variable I declared in my MainModule. In my MainForm, I put a showmessage for me to check the value of the variable. the problem is that if I log in a user in a browser and then log in another user in another browser, when I try to display the ID of the first user who logged in, the second one appears. How can I solve this problem? each user must display his corresponding ID in each browser. Quote Link to comment Share on other sites More sharing options...
rencarnacion Posted April 20, 2023 Share Posted April 20, 2023 If you declare your global variables in main module must be onle for the session is using Quote Link to comment Share on other sites More sharing options...
Alex B. Posted April 25, 2023 Author Share Posted April 25, 2023 Thanks for your response. Yes, I declared my variable in the main module, I put a showmessage in the KeyDown event for the F3 key so I can check the variable's value, but it is changing as you can see in the video. Desenv Eduardo Seatlle GMWeb GMWEB 301-164-287 Desenvolvimento Multistore 2023-04-25 09-08-55.mp4 Quote Link to comment Share on other sites More sharing options...
lcolombo Posted May 5, 2023 Share Posted May 5, 2023 Hi, You should not declare a global variable, but a public variable in MainModule class unit MainModule; interface uses uniGUIMainModule, SysUtils, Classes, uniGUIBaseClasses, uniGUIClasses; type TUniMainModule = class(TUniGUIMainModule) UniNaImLtSistema: TUniNativeImageList; procedure UniGUIMainModuleSessionTimeout(ASession: TObject; var ExtendTimeOut: Integer); procedure UniGUIMainModuleCreate(Sender: TObject); procedure UniGUIMainModuleBrowserClose(Sender: TObject); procedure UniGUIMainModuleDestroy(Sender: TObject); private public vGlobalVariable: string; end; 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.