After validating a user's email and password, where should the user's session variable be set, in the Controller or can it be set in the View? Does it matter where it is set?
Thanks,
Mark
PHPWeb DevelopmentWeb ApplicationsWeb FrameworksWeb Languages and Standards
As MVC I use CodeIgniter, so I don't know if this can be true for your specific environment, but I usually set session values from the controller. It is possible to do it even in view but the correct way is to keep code in controller (as keeping database stuff in models).
In the controller, you can use standard php $_SESSION array or, it it exists, your framework session class.
userTester
ASKER
Thank you Ray, you provided valuable extra information with that link. Thanks to you too Marco, you basically confirmed what Ray had mentioned.
In the controller, you can use standard php $_SESSION array or, it it exists, your framework session class.