I'm wiriting up some PHP using a command pattern type of design. Here's my directory setup:
I'm running into a problem with session_start and how it only works within a directory. Here's a scenerio.
I'm and admin, I go to www.mysite.com/admin and enter my login credentials.
The form action points to ../command.php?commandName=UserLogin, which calls a UserLogin method to login. This is where user data is stored in the session.
I logged in alright, except because of the session_start issue, when /admin/main.php looks for $_SESSION["Logged_In"], it's empty.
My question is this, how do you all do you session_start stuff and still keep a somewhat complex but neat directory structure, while maintaining some kind of command type pattern as I am?
Thanks
Code:
/include/command/CommandRouter.php // Routes command to proper command object
/include/command/UserLogin.php // Class implementing ICommand
/include/command/ICommand.php // Command object interface
/admin/index.php // admin login form
/admin/main.php // admin dashboad from successful admin login
/index.php // Normal user login
/command.php // Makes a commandRouter, gets the command response, and forwards to result page
I'm running into a problem with session_start and how it only works within a directory. Here's a scenerio.
I'm and admin, I go to www.mysite.com/admin and enter my login credentials.
The form action points to ../command.php?commandName=UserLogin, which calls a UserLogin method to login. This is where user data is stored in the session.
I logged in alright, except because of the session_start issue, when /admin/main.php looks for $_SESSION["Logged_In"], it's empty.
My question is this, how do you all do you session_start stuff and still keep a somewhat complex but neat directory structure, while maintaining some kind of command type pattern as I am?
Thanks