I'm not sure how to explain this fully, so please bear with.
My dev environment is on a vagrant box and is working fine. I've just uploaded to the production site and am having some issues. The production site is a dedicated server.
I have a login that processes through a SessionsController
. On submission, we use Session::store()
to redirect either to the homepage if successful, or to the login page if there's an error, like this:
public function store()
{
$input = Input::all();
$attempt = Auth::attempt([
'email' => $input['email']
, 'password' => $input['password']
]);
if($attempt)
{
return Redirect::home()->with(['flash_message'=>'You have been logged in.']);
}
else
{
return Redirect::back()->with(['flash_message'=>'Your UserName or Password are incorrect. Please try again']);
}
}
Again, this is working fine on the dev environment. On the production server however, I get a page that loads in between, and the flash message info isn't pulling through.
Click 'Login'
See /sessions
link in the address bar and an onscreen message that says: "Redirecting to site.com/login"
Browser redirects to /login
but with no flash message.
I get the same thing if I try to use any of the other functionality, such as creating a new user. The user is added, but because the screen /user
shows with a message that says: "Redirecting to site.com/user" I do not get the flash message feedback.
I suspect this is an issue in the production server settings as it's working as expected in the dev environment, but am not sure where to look.
No! I don't want that middle page and that's what's breaking it! Sorry if I'm confusing this.
On my local environment it just works as you'd expect. On my production machine it throws up the stupid middle page, which breaks the flash message that's being sent through (I'm assuming) because the server is trying to do something stupid rather than letting Laravel handle the redirect?
I don't know how the Laravel Redirect:: actually works - maybe it's a conflict of some sort??
I've just found the solution: http://forumsarchive.laravel.io/viewtopic.php?id=11742
There was a bloody space in my routes file that caused it to load incorrectly on the production server. Still not sure why it worked on the dev environment though...
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community