Welcome Guest, Not a member yet? Register   Sign In
Have to refresh pages to view current data
#1

[eluser]Dave S[/eluser]
I'm creating a simple website where members can log in. If they are logged in, the header displays different data than it would to someone who is not logged in.

I have finally been able to get this all working with one exception. I will try to explain the problem by using an example.

If the person enters their login information and submits they are taken to http://site.com/login. The login controller validates the info and if successful, displays a view telling the user they are logged in.

Here is the problem. If the user then goes back to http://site.com/ (or any other page) by typing the url in the browser, they still get the header with the login fields, and have to hit refresh to see the "welcome" info that logged in users should see. However, if they click the "home" link from the view telling them they are logged in, everything is fine.

The same thing happens when they log out. They get a view telling them they're logged out. If they type in any url on the site they still see the logged in header unless they hit refresh.

I hope that makes sense. Does anyone have any ideas on what might be going on? I have the code to check if the user is logged in right in the constructor for any of the controllers that require it.

Thanks in advance!




Theme © iAndrew 2016 - Forum software by © MyBB