Skip to content
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

Redirect problem with https if force close #865

Closed
wants to merge 9 commits into from
Closed

Conversation

ikwijaya
Copy link

@ikwijaya ikwijaya commented Sep 3, 2017

Sir,

Wow, thanks for great framework. I used that with https, but if i force close my webpage, the redirect always use http:https:// protocol so i change code a bit. Path : application/core/redirect. here my code.

before :
public static function toPreviousViewedPageAfterLogin($path) { header('location: http:https://' . $_SERVER['HTTP_HOST'] . '/' . $path); }

here my edit :
public static function toPreviousViewedPageAfterLogin($path) { if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') { $protocol = "https"; } else { $protocol = "http"; } header('location: '. $protocol . ':https://' . $_SERVER['HTTP_HOST'] . '/' . $path); }

what about that?

regards
ikwijaya

@ikwijaya
Copy link
Author

thank for merge.

@ikwijaya ikwijaya closed this Oct 13, 2018
@elbenjaz
Copy link

elbenjaz commented Apr 10, 2019

Wow,
This feature is not in master branch.
I solved it with a similar fix (After reading this post, it is practically a clone):

public static function toPreviousViewedPageAfterLogin($path) { $protocol = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off' ? "https://" : "http:https://"; header('location: '.$protocol . $_SERVER['HTTP_HOST'] . '/' .$path); }

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants