HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Session Handling for anonymous user.

edited September 2009 in Feedback
Hi,

Please can anyone review my thoughts on custom session handler for anonymous user? It will be very helpful for me as well for the other application and plugin developer.

In our current project we have planned to go with Garden framework but the problem is that we need to keep the track of some info when the anonymous user is browsing the site.

To make it work I am planning to create one new class called CustomSession with two function
GetSessionValue($Attributes) and SetSessionValue($Atttributes, $values) and one database table
called anonymoususerdata consisting of fields called (CookieId, SessionData).

Once this is set in place all the applications and plugins can use this class to track the session data.

The GetSessionValue() and SetSessionValue() will check whether the user is logged in or not. If the user is anonymous the data will be stored and retrieved from the anonymoususerdata with the help of CookieId. And if the user is logged in the CustomSession class will use the Attributes Columns of user table.

The next major task left is to transfer the data from the anonymoususerdata to the user table so that for authenticated user's data will be tracked from User table.
This step will be implemented in the Start() method of Garden Session Class.

Comments are most welcome.

Please forgive me for my bad english.
Tagged:
Sign In or Register to comment.