Sessions in AWP mode

Startbeitrag von Arekusei Timakobu am 26.02.2016 08:51

Could you please someone to explain how to work correctly with sessions (session variables) in WebDev in AWP mode? The documentation does not give any normal example. I used to understand sessions as they work in php - I just use session_start() and then I can use $_SESSION array everywhere. I thought the concept in WebDev is the same. I use this code for initialization session in Global Init of project:

SessionObject is class
UserID is string
SessionID is string
... // other members

gobjSession is SessionObject


Then I suppose I can use gobjSession object in my code. I.e. I can save UserID after successfull login, save some little cached information. Should I do call of DeclareAWPContext somewhere except global code?


In addition, when I tried to save session identifier I did so:

IF NOT DeclareAWPContext(gsSessionID) THEN
gsSessionID = IdentifierAWPContext()

Then I saw the function DeclareAWPContext always returns False and function IdentifierAWPContext() returns value only one (first) time. Why the identifier is returned once and why the value is not restored from context? I expected that function DeclareAWPContext must return True as described in docs:

WinDev Doc

// -- Initialization code of project
gnNumCurrentProduct is int = 1

// Indicate that the value of gnNumCurrentProduct must be saved
// whenever an AWP page is displayed

// During the next displays of the page:
// - either the value of gnNumCurrentProduct is not retrieved
// and it is automatically reinitialized with "1"
// (during the first display of the page for example)
// or the value of gnNumCurrentProduct is retrieved and used
// (during the next displays for example)

von Arekusei Timakobu - am 26.02.2016 09:22
Zur Information: hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.