|
FOROS PROFESIONALES WINDEV, WEBDEV y WINDEV Mobile |
| | | | | |
| Iniciado por guest, 26,feb. 2016 09:51 - 1 respuesta |
| |
| | | |
|
| |
| Publicado el 26,febrero 2016 - 09: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 END gobjSession is SessionObject ConfigureAWPContext(ctxDisk) DeclareAWPContext(gobjSession)
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? |
| |
| |
| | | |
|
| | |
| |
| Publicado el 26,febrero 2016 - 10:22 |
In addition, when I tried to save session identifier I did so:
IF NOT DeclareAWPContext(gsSessionID) THEN gsSessionID = IdentifierAWPContext() END
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:
Quote 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 DeclareAWPContext(gnNumCurrentProduct)
// 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) |
| |
| |
| | | |
|
| | | | |
| | |
| | |
| |
|
|
|