|
Sessions and AWP Contexts |
Débuté par Luis García, 31 aoû. 2017 13:38 - 6 réponses |
| |
| | | |
|
| |
Posté le 31 août 2017 - 13:38 |
Hi. I'm trying to figure out how Webdev manages sessions. I've been reading the PCSoft documentation about AWP Contexts, but I don't get to fully understand it; I really miss a good tutorial or full example on how to manage AWP contexts.
In PHP it is very easy to understand and manage session variables:
How can this be accomplished with Webdev? Is it even possible? Is there any good documentation, article, video, etc... explaining how to properly manage sessions?
All I need is a simple example showing how to store and retrieve sessions variables.
Thank you very much. |
| |
| |
| | | |
|
| | |
| |
Posté le 31 août 2017 - 14:51 |
Hi
In AWP mode, I personnaly manage my variables myself, in the DB. I just pass a session ID as parameter to all pages, and when I have getVariable and SetVariable functions that read and write in a parameter file when needed.
Very simple, very robust, no limits, and does not rely on anything outside my code.
Best regards
-- Fabrice Harari International WinDev, WebDev and WinDev mobile Consulting
Ready for you: WXShowroom.com, WXReplication (open source) and now WXEDM (open source)
More information on http://www.fabriceharari.com
Le 8/31/2017 à 5:38 AM, "ÿÿÿÿÿÿÿÿÿ" a écrit :
Hi. I'm trying to figure out how Webdev manages sessions. I've been reading the PCSoft documentation about AWP Contexts, but I don't get to fully understand it; I really miss a good tutorial or full example on how to manage AWP contexts. In PHP it is very easy to understand and manage session variables:
How can this be accomplished with Webdev? Is it even possible? Is there any good documentation, article, video, etc... explaining how to properly manage sessions? All I need is a simple example showing how to store and retrieve sessions variables. Thank you very much. |
| |
| |
| | | |
|
| | |
| |
Posté le 31 août 2017 - 15:08 |
How do you manage dead sessions ? Have you implemented some mechanism to detect dead sessions (inactive, timed-out ...) or you arbitrary throw away session after some predefined period of inactivity ?
Fabrice Harari explained :
Hi In AWP mode, I personnaly manage my variables myself, in the DB. I just pass a session ID as parameter to all pages, and when I have getVariable and SetVariable functions that read and write in a parameter file when needed. Very simple, very robust, no limits, and does not rely on anything outside my code. Best regards -- Fabrice Harari International WinDev, WebDev and WinDev mobile Consulting Ready for you: WXShowroom.com, WXReplication (open source) and now WXEDM (open source) More information on http://www.fabriceharari.comLe 8/31/2017 à 5:38 AM, "ÿÿÿÿÿÿÿÿÿ" a écrit : |
| |
| |
| | | |
|
| | |
| |
Posté le 31 août 2017 - 15:41 |
Hi,
How do you manage dead sessions ? Have you implemented some mechanism to detect dead sessions (inactive, timed-out ...) or you arbitrary throw away session after some predefined period of inactivity ?
It depends on the need of the website...
Mostly, I store the last time the session is called (ie in the page init area of the main page template) inside the session record.
In some cases, I have a keep alive mechanism in the page template calling the server every n minutes to keep the session alive
And of course, during each call to the session, I verify that the session is valid based on the requirement of the web site: - it can be a simple time out (more than the n minutes, ie the browser is closed) - it can also be a check on the IP calling in - It can also be a check on a browser/pc fingerprinting (type of browser, version, language, etc) - and of course, I also know that way if the session is anonymous or if the user is logged in, which user, his rights, etc - This ALSO allows me, if needed, to get BACK to a session content (cart content, by example) several days later when the user/pc is identified
It's fully flexible as I can code basically anything inside that standard mechanism
Best regards
-- Fabrice Harari International WinDev, WebDev and WinDev mobile Consulting
Ready for you: WXShowroom.com, WXReplication (open source) and now WXEDM (open source)
More information on http://www.fabriceharari.com
Fabrice Harari explained : Hi In AWP mode, I personnaly manage my variables myself, in the DB. I just pass a session ID as parameter to all pages, and when I have getVariable and SetVariable functions that read and write in a parameter file when needed. Very simple, very robust, no limits, and does not rely on anything outside my code. Best regards -- Fabrice Harari International WinDev, WebDev and WinDev mobile Consulting Ready for you: WXShowroom.com, WXReplication (open source) and now WXEDM (open source) More information on http://www.fabriceharari.comLe 8/31/2017 à 5:38 AM, "ÿÿÿÿÿÿÿÿÿ" a écrit : |
| |
| |
| | | |
|
| | |
| |
Membre enregistré 11 messages |
|
Posté le 31 août 2017 - 16:26 |
I think that Mr. Harari's solution is a very clever one: It really has convinced me, and I'll try to convince my boss to apply it. Thank you.
However, may I ask you something, please? Why don't you rely on native Webdev mechanism (AWP contexts)? I mean, reading your answers, it seems to me that it's still not as a good method for managing sessions as you would wish.
Don't you think that it's kind of a pity that Webdev is still not able to replicate the behaviour of PHP, in such an easy and simple way? I also find it a big limitation the fact that I can only store simple-type variables in contexts...
By the way, I still would like someone to explain to me how exactly AWP contexts work.
Thank you very much.
PS: Please keep in mind that I'm totally new to web development in general, and specially to Webdev. Maybe I'm asking stupid questions. In that case, please excuse me... and teach me a little bit on the matter |
| |
| |
| | | |
|
| | |
| |
Posté le 31 août 2017 - 16:48 |
Hi again,
Le 8/31/2017 à 8:26 AM, "ÿÿÿÿÿÿÿÿÿ" a écrit :
I think that Mr. Harari's solution is a very clever one: It really has convinced me, and I'll try to convince my boss to apply it. Thank you.
However, may I ask you something, please? Why don't you rely on native Webdev mechanism (AWP contexts)? I mean, reading your answers, it seems to me that it's still not as a good method for managing sessions as you would wish.
Don't you think that it's kind of a pity that Webdev is still not able to replicate the behaviour of PHP, in such an easy and simple way? I also find it a big limitation the fact that I can only store simple-type variables in contexts...
Webdev is able to do much more than php (in classic/intranet/extranet mode) if you don't need SEO.
As for the awp mode, the session management system I described is just a few hours of development, so I certainly do not count that as a big deal.
And as for all standard mechanism (being PHP or anything else), they are only good as long as you have standard needs, and my personal experience is that my customers are rarely cookie cutter shaped. So I prefer to build a mechanism like this one from scratch so that I have FULL flexibility.
By the way, I still would like someone to explain to me how exactly AWP contexts work.
I'm not sure what else to tell you that isn't already there: https://doc.pcsoft.fr/en-US/?3539060&name=awp_gestion_des_contextes
Basically, you declare a context mode (client cookie or server disk) and webdev saves your variables at the chosen place when you asks it to then retrieves them later.
So my system is basically working the same way, except that I do not have any of the limitations described in the help, and I can add easily other functions to the system.
Best regards
-- Fabrice Harari International WinDev, WebDev and WinDev mobile Consulting
Ready for you: WXShowroom.com, WXReplication (open source) and now WXEDM (open source)
More information on http://www.fabriceharari.com
Thank you very much. PS: Please keep in mind that I'm totally new to web development in general, and specially to Webdev. Maybe I'm asking stupid questions. In that case, please excuse me... and teach me a little bit on the matter |
| |
| |
| | | |
|
| | |
| |
Membre enregistré 11 messages |
|
Posté le 31 août 2017 - 17:35 |
Fabrice Harari wrote:
The problem I have with that documentation is that I find it a bit confusing. Of course, that's probably because of my newbie condition, but I still miss a good and brief piece of code that demonstrates how AWP contexts work, in the way of the screenshots I posted before.
On the other hand, I'm very grateful for your attention. My boss also liked your idea and I'm already working on it. I'm learning a lot. Thank you. |
| |
| |
| | | |
|
| | | | |
| | |
|