views:

76

answers:

1

I am trying to create a secure login for my site, who's form logs in with AJAX. Unfortunately, as it currently stands, I am sending the username and password using http completely unencrypted. After looking through basic encryption methods in Javascript that I can port to Codeigniter to decrypt, I've read that the best thing to do is just use HTTPS to send the data. So basically what I want to do is this:

  1. Someone fills out their credentials on my site.
  2. The data gets ajaxed to https//:MY-SITE.com/ajax/login
  3. It responds as normal.

Unfortunately, when I set this up, my AJAX function that had been working when using http stopped sending the response it was supposed to send. Do I need to do something extra to get my AJAX function properly read with codeigniter using HTTPS?

A: 

You can't request information between HTTP and HTTPS using AJAX due to cross-domain issues. To get this to work, consider implementing JSONP as part of your login script. This way, you can perform the login between domains.

jQuery has a great JSONP implementation; it's worth checking out if you're not using it already.

mattbasta