New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unwanted screen using 3.3.2 framework on IIS #610

Closed
frkinta opened this Issue Sep 1, 2016 · 6 comments

Comments

Projects
None yet
2 participants
@frkinta
Contributor

frkinta commented Sep 1, 2016

Hello.

I'm testing a new environment (windows server 2008, IIS 7.5, PHP 5.6.24). I've run the login form used in the #608 issue i previously submit and this screen (image) appear forcing me to click before going to the next page.
image

This occur when I use the 332 framework and not on the 324 framework.
issue_iis.zip

@frkinta frkinta changed the title from Unwanted screen on IIS using the 3.3.2 framework to Unwanted screen using 3.3.2 framework on IIS Sep 1, 2016

@ctrlaltca

This comment has been minimized.

Member

ctrlaltca commented Sep 5, 2016

The login button is probably redirecting to a null page.

$this->Response->redirect($this->Request->constructUrl($this->Service->ID, 'login_old'));

This should look like:

$this->Response->redirect($this->Service->constructUrl('NameOfThePage', array('param' => 'value'));

You also check the return value of constructUrl to ensure the returned url is actually valid.

@frkinta

This comment has been minimized.

Contributor

frkinta commented Sep 5, 2016

Thank you for your answer.
The login button is redirecting to an existing page. After changing the constructor, the problem still remain.

@frkinta

This comment has been minimized.

Contributor

frkinta commented Jan 18, 2017

Hello,

When I change the "helloworld" home.php to

class home extends TPage {
    public function buttonClicked($sender, $param) {
        $this->Response->redirect('home');
    }
}

on IIS 7.5/Windows server I have the issue described before

ctrlaltca added a commit that referenced this issue Jan 18, 2017

@ctrlaltca ctrlaltca closed this in 0c47440 Jan 18, 2017

@ctrlaltca

This comment has been minimized.

Member

ctrlaltca commented Jan 18, 2017

So, here's the backstory:
When you redirect(), prado internally sends a Location header using php's header function.
PHP states that:

The second special case is the "Location:" header. Not only does it send this header back to the browser, but it also returns a REDIRECT (302) status code to the browser unless the 201 or a 3xx status code has already been set.

This is currently not working as expected on IIS, so the fix was to force sending the correct http status code.

@ctrlaltca

This comment has been minimized.

Member

ctrlaltca commented Jan 18, 2017

As an unrelated note, i see in you code:

$this->Response->redirect('home');

while you may probably want to use instead:

$this->Response->redirect($this->Service->constructUrl('home'));
@frkinta

This comment has been minimized.

Contributor

frkinta commented Jan 18, 2017

It work.
I can now use the latest on my projects. Thank for your advise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment