Welcome Guest, Not a member yet? Register   Sign In
Building application structure - problems with controllers?
#6

[eluser]CroNiX[/eluser]
Why would you do it that way? The problem is self-caused.

When someone logs in, you should store their data in session and then redirect back to where they were before logging in, or a profile page or something. Now they are logged in and you can display different info based on their userlevel, or however you have it set up. It's a new request (because of the redirect), so you would be able to use any methods in your home controller.

So, they are on the homepage and log in, which sends their form data to the login controller. Login Controller saves their user information in session and then redirects them back to the homepage where they were when they logged in. Now they are on the same page as they were before, but logged in (in which case you wouldn't display the login form anymore, kind of like how it is on this site.)


Messages In This Thread
Building application structure - problems with controllers? - by El Forum - 07-12-2012, 01:57 PM



Theme © iAndrew 2016 - Forum software by © MyBB