I'd like to figure out how to store multiple values in a single session variable. This is for a login application, where the user can have multiple user_types. So when user logs in, I want to create a session variable that stores all of that user's user_types. For example if a user with user_id of 3 logs in, I want to query the user_type_match table for all of the user_type_id's where user_id equals 3. Then store all the matching user_type_id's, whether it be one, two, or five, in a single session variable. That way, as an already logged in user tries to enter different areas of the site, I can automatically know if they have access to that area.
Here's the query to get all the user's user_type_id's:
Any ideas?
Here's the query to get all the user's user_type_id's:
Code:
<cfquery name="get_user_types" datasource="#app.ds#">
SELECT user_id, user_type_id
FROM user_type_match
WHERE user_id = #session.user_id#
</cfquery>
<cfif get_user_types.recordcount GT 0>
Here's where I would set the session variable ...if I knew how.
</cfif>
Any ideas?