I'm building a website where there are 3 kinds of login pages for different type of users (ex. customers and salesmen). There are some pages that should be accessible only for specified users. If somebody tries to enter a specific page, I would like the script to check whether that person is allowed to do so.
The way I see it, I should create different session names at each login page and when somebody's trying to access a specific page, to check whether it's the right person in the right place.
I know that checking if ANY session exists can be done via
isset($_SESSION)
and I also found some information about session_name here: http://php.net/manual/en/function.session-name.php
but I don't seem to put those two things together. Could anybody suggest a solution? I've been learning PHP for 3 weeks, so please go easy on me.