Skip to content
Read For Learn
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP

Custom Login with Ajax not working with IE

Finally found out the culprit and solved the problem 🙂 IE caches AJAX requests. So whenever you use AJAX call to set login cookies, you are in for a trouble in IE. Beware!!!!! In your ajax call fill in a random number in the URL so that IE wont catch

In the Ajax call inserted this

    var d = new Date();
    var n = d.getTime();
    req.open("GET", "something.php?user"+username+"&x="+n);

By doing this IE wont cache the AJAX request

Related Posts:

  1. wp_set_auth_cookie() doesn’t work in Ajax call
  2. WordPress AJAX Login Screen
  3. Detecting post type within init action
  4. WordPress Ajax Login without page reload
  5. WordPress Nonce Issue for Ajax Login and Logout
  6. How can I automatically login using a URL?
  7. how to use reCaptcha v3 in wordpress custom login form?
  8. Is it safe to manually sign a user in using AJAX?
  9. Why a strange discrepency between get_current_user_id() when using AJAX versus output of document.cookie?
  10. Ajax login without redirect/reload
  11. Interim-Login form on frontend
  12. jQuery.post returns 0
  13. Ajax login fails: script sets cookies, but is_user_logged_in() returns false
  14. WordPress custom ajax login not working on mobile browsers
  15. I’m trying to register with AJAX
  16. Nonce verification problem when logging in after a logout
  17. PHP “php://input” vs $_POST
  18. Google Maps API throws “Uncaught ReferenceError: google is not defined” only when using AJAX
  19. Access-Control-Allow-Origin error sending a jQuery Post to Google API’s
  20. Access-Control-Allow-Origin error sending a jQuery Post to Google API’s
  21. How to solve the error “SCRIPT7002: XMLHttpRequest: Network Error 0x80070005, Access is denied.” in IE
  22. Show spinner GIF during an $http request in AngularJS?
  23. Refresh HTML Page in Browser Automatically on Timer – Every 15 Min
  24. JavaScript implementation of Gzip
  25. jQuery: Performing synchronous AJAX requests
  26. ASP.NET MVC controller actions that return JSON or partial html
  27. jQuery’s .on() method combined with the submit event
  28. Ajax takes 10x as long as it should/could
  29. How to check if I am in admin-ajax.php?
  30. Best way to end WordPress ajax request and why?
  31. How to load wp_editor() through AJAX/jQuery
  32. How to cache json with wp-super cache
  33. Load minimum WordPress environment
  34. Why use wp_send_json() over echo json_encode()?
  35. Why use admin-ajax.php and how does it work?
  36. How to get a unique nonce for each Ajax request?
  37. Open a Thickbox with content trough AJAX
  38. Initialize TinyMCE editor / visual editor after AJAX insert
  39. Why not register shortcodes if is_admin dashboard?
  40. WordPress AJAX with Axios
  41. Why is die() used at the end of function that handles an Ajax request?
  42. Why might a plugin’s ‘do_shortcode’ not work in an AJAX request?
  43. Making my AJAX powered WordPress Crawlable
  44. Is there a JavaScript API? How to access public and private data in JS?
  45. Get Previous & Next posts by Post ID
  46. failed to load wp-admin/admin-ajax.php
  47. Using Backbone with the WordPress AJAX API
  48. Using Ajax with a Class file
  49. Ajax in a settings page (update_option is undefined)
  50. How to pass data parameter to ajax action function handler
  51. WordPress Ajax Data Security
  52. Displaying PHP Errors from admin-ajax.php
  53. Adding “Remember Me” in custom login
  54. gettext does not translate when called in ajax
  55. Execute one AJAX request after another AJAX request finished
  56. WP-AJAX vs WP REST API: What to use for requests to the website from outside?
  57. Ajax and autocomplete
  58. How can I make an Ajax login form work with FORCE_SSL_ADMIN enabled?
  59. How to add to cart via AJAX Woocommerce [closed]
  60. Nonces and Cache
  61. SSL breaks customizer: page isn’t returned from ajax
  62. Why is a 500 error generated by admin-ajax.php not going into the Apache error log?
  63. Are ‘wp_ajax’ and ‘wp_ajax_nopriv’ exclusive to authenticated and non-authenticated users?
  64. How to HTML5 FormData Ajax
  65. admin-ajax.php vs Custom Page Template for Ajax Requests
  66. How to override WP_DEBUG for Ajax responses?
  67. Stop admin-ajax?
  68. redirect out of wp-admin, without losing admin-ajax.php
  69. Call to undefined function add_action()
  70. Is it safe to assume that a nonce may be validated more than once?
  71. How build a custom login/register form with error handling?
  72. Including WordPress in RESTful API
  73. Multiple ajax nonce requests
  74. Get posts with ajax
  75. admin-ajax.php doesn’t work when using POST data and Axios
  76. How to call a PHP function with Ajax when the user clicks a button
  77. REST API endpoint for elasticpress autosuggest
  78. Ajax for non-logged-in users
  79. Contact Form 7 Custom Post Action
  80. Custom Form with Ajax
  81. How to process ajax requests correctly using ajax plugins
  82. ajax – why multiple calls to wp_create_nonce() return same value?
  83. Update user meta using with ajax
  84. Registering AJAX callback function that is part of a class without instantiating the class in function.php
  85. WordPress function that makes HTML safe to be sent via AJAX request
  86. How do I hook an Ajax request into a PHP callback?
  87. AJAX request on the frontend always returns 0 if user is not admin
  88. admin-ajax.php returns 0. How do I debug it and fix it?
  89. Ajax requests without JQuery
  90. Admin Notification after save_post, when ajax saving in gutenberg
  91. How to properly use wp.ajax.post?
  92. Load tinyMCE / wp_editor() via AJAX [duplicate]
  93. How to tie built in AJAX to an add_action?
  94. Using Nonces for AJAX that only retrieves data
  95. AJAX vs Fragment Caching for W3 Total Cache [closed]
  96. Saving (Updating) Post / Page Edits With AJAX
  97. Is there any way of of making an admin-ajax request without the use of die()?
  98. How to verify nonce from Bulk/Quick Edit in save_post?
  99. Using ajax on categories and wordpress loops
  100. Custom PHP endpoint for a plugin’s AJAX call
Categories ajax Tags ajax, login
Link listings with image
How can i remove the posts category class names from body_class

Recommended Hostings

Cloudways: Realize Your Website's Potential With Flexible & Affordable Hosting. 24/7/365 Support, Managed Security, Automated Backups, and 24/7 Real-time Monitoring.

FastComet: Fast SSD Hosting, Free Migration, Hack-Free Security, 24/7 Super Fast Support, 45 Day Money Back Guarantee.

Recent Added Topics

  • Bug in translation system: load_theme_textdomain() returns true, files are available and accessible but the language defaults to english
  • Post Navigation Elementor
  • Custom Elementor controls not appearing in the widget Advanced tab using injection hooks
  • WPFacet multiple loop displaying duplicate content
  • Get the name of the template/*html file used
  • Fix: WordPress.DB.PreparedSQL.NotPrepared Plugin Check (PCP)
  • Removing unnecessary CSS and JS code from wp_head()
  • hexagonal image gallery. Am I on the right track? [closed]
  • Trying to Add Paging to Single Post Page
  • Sharing media files between live and staging servers
© 2026 Read For Learn
  • Database
    • Oracle
    • SQL
  • algorithm
  • asp.net
  • assembly
  • binary
  • c#
  • Git
  • hex
  • HTML
  • iOS
  • language angnostic
  • math
  • matlab
  • Tips & Trick
  • Tools
  • windows
  • C
  • C++
  • Java
  • javascript
  • Python
  • R
  • Java Script
  • jQuery
  • PHP
  • WordPress