I created a simple PHP login authentication script, now i want to override the posting of data from the form to the auth script so that it does it via ajax.
I made it so that the PHP returns JSON data in the format {"success":[1 OR 0],"error";"ANY ERROR MESSAGE RELATED TO SUCCESS = 0"}
, this works perfectly and when i try and use the login form it returns success:1
when i serialize the form and post it to the auth script with a correct username+password and it returns success:0
and the reason why with an incorrect login, on the original method where the form posted to the auth script, then the auth script redirected to a protected page after succesful login i have replaced this with the javascript changing the window location after it recieves a succesful login, only problem being is that is seems the session variables havent been set from posting to the auth script via this method.
Is there a way i can make the session variables stick without actually having to direct to the page?