The Mojavi 3 Book/Core Components/User

< The Mojavi 3 Book

The User is an object to represent a visitor in a website using the Mojavi system. Each unqiue visit to the website is represented by a separate instance of the User class and that object is persistant for the life of that visitor's session. This is a great advantange in the Mojavi system in that you can maintain information pertaining to that session in an organized and logical way.

The User object is special in that is uses a Storage object to obtain data persistence. Because of this, you can store data specific to that visitor. You can do this by making a call to the User method setAttribute() and store the data there. This could be information about the user, such as their name, address or occupation. Or it would be information specific to that session, such as storing data from a multipage form. At any point during that visitor's session you can retrieve that same data by calling getAttribute().

The User can also be used to set up security for the website. Using a SecurityUser class, you can check the credentials of a visitor to see if they have permissions to be in restricted sections of the website.

In the User class you also have parameters that you can set to initialize custom implementations of the User class.