As a Web Page newbie, I am struggling a bit with the Session concept. If I create session Integer and maybe Boolean variables, does each visitor get his or her own set of variables?
I mean can I use these variables to track how many and which pages a particular visitor has accessed so I can program the way a button reacts to a click? Or am I not understanding the Session concept?
While on the subject, I want people to register and create user names, passwords etc. Once they have done so. If they return in the future and log in, can each page they access determine whether or not they have a valid ID and who they are?
Each user gets their own Session object and any properties that you create on the session or any WebPages that spawn from that session are “user specific”.
Items that you place in Modules or the App class are global, that is, all users will have access to the same properties.
There are ways to alleviate this problem such as storing classes or properties inside a dictionary where the key is the value of the Session.Identifier, however you will need to manage cleaning those things up when a session ends.
Thanks Greg, well I want the properties to be user-specific in the section of the website before the visitors actually register for usernames and passwords and are entered into a database.
So I read what you say to mean that if there is a Session integer property called pagesSeen, say, and it counts the number of times a visitor sees different pages by incrementing every time the visitor presses a “Show secondPage”, “Show tenthPage” button etc I can examine this property from time to time during their visit and use it but it will vanish when the visitor leaves. Also, presumably, Session seenPage2 and seenPage10 booleans set to true the same way will tell me that this particular visitor has seen those pages but again it will vanish when the visitor leaves. That’s just what I want.
After they register and get user names and then return and log in to access the members-only pages, I need to know at all times what the user name is of the person accessing the site so that I know not only that they are entitled to be at a particular page but also which member they are. Is this straightforward?