Jump to content

Maintaining State - Session Variables


acesar

Recommended Posts

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?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...