views:

36

answers:

1

Hi,

How would I apply SSL HTTPS to my PHP Login system. My login system is basic here is how it goes:

Fetches session and user then checks if its correct. I'll need some kind of SSL/HTTPS checking.

Any examples?

+2  A: 

Your question makes little sense. SSL is a secure transport layer, but its operation is totally transparent to PHP.

Everything that worked before you had SSL should work the same way it does with SSL. All the authentication and encryption/decryption is done automatically for you.

See:

NullUserException
I am basically going to assign myself a SSL cert, I want it to work with my login system.
Raymond
@Raymond If you set up SSL correctly, it should work without any changes to your PHP code - at least the login logic. You might want to make the script force the user to use SSL on login however, but just try to make SSL work in the first place.
NullUserException
I saw some things to do with HTTPS in someones coding before on there login system. Just was not sure what it is. Do I need that?
Raymond
@Raymond You'll need to be more specific. What "things"?
NullUserException
HTTPS: something like this "function redirectToHTTPS(){ if($_SERVER['HTTPS']!="on") { $redirect= "https://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; header("Location:$redirect"); }"
Raymond
@Raymond Yeah, that forces the page to use HTTPS instead of HTTP. But I would focus on getting HTTPS to work in the first place for now (that can be a bit tricky)
NullUserException
How do I get it to work via Windows 2008/2003?
Raymond
@Ray What server are you using? (eg: Apache, IIS, etc)
NullUserException
Apache mate (XAMPP)
Raymond
@Ray See the second link on my answer
NullUserException