CodeIgniter Forums
Problem in login system while using Ajax - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Problem in login system while using Ajax (/showthread.php?tid=23166)

Pages: 1 2


Problem in login system while using Ajax - El Forum - 10-03-2009

[eluser]FutureKing[/eluser]
[quote author="n0xie" date="1254587976"]Just call a function which checks for the message 'user not logged in' like I said before as part of the callback. Else you make your problem more complex than it actually is.

Code:
$.post('somepage', 'some params', function (data) {
      // add this to your ajaxcalls:
      mylogincheckfunction(data);
      // do normal stuff here
      }
);

function mylogincheckfunction(obj){
if (obj.loggedin == false)
   // redirect windows.href or windows.location
}
[/quote]

Thanks.