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

Creating login session via CURL

Not sure its a session issue, i think it has to do with the fact that WordPress Dashboard uses relative links.

A quick hackish fix would be to add

curl_setopt($ch,CURL_COOKIEFILE, '');  // Enables session support

Then, add this after closing the curl handler redirect to the actual dashbard location:

curl_close($ch);
header('location: blog/wordpress/wp-admin/');
die();

Related Posts:

  1. Programmatic Login from 3rd Party site
  2. What’s the net::ERR_HTTP2_PROTOCOL_ERROR about?
  3. User registration followed by automatic login
  4. Uploading media with the REST API
  5. Adding “Remember Me” in custom login
  6. cURL 28 error after switch from to brew php 7.2 on localhost
  7. How to change the wp-login.php page title?
  8. How build a custom login/register form with error handling?
  9. Creating a post with the REST API, curl and oauth returning 401 error
  10. Change the footer text on the login page
  11. Changing user_nicename
  12. WordPress 4 invalid username special charachters issue
  13. How to place login logout link on menu that redirects users back to current page?
  14. How to turn off redirection from ‘domain.com/login’ to ‘domain.com/wp-login.php’
  15. How to resolve error “Cookies are blocked due to unexpected output.”?
  16. Using a nonce in a Custom Login Form
  17. Constructing a custom login form using ajax
  18. automated tests as a user?
  19. Remove username in emails or swap username for email
  20. woocommerce and is_user_logged_in() if not redirect to homepage
  21. Use wp_remote_get to get JSON instagram feed from public profile
  22. Check if user is logged in when clicking certain links on certain pages
  23. PHP If user is logged in & on home page redirect
  24. WordPress shows registration link for non logged users
  25. Admin username and password
  26. Recovering WP Login Credintials in Code?
  27. Is it necessary to sanitize wp_set_password user input?
  28. WordPress custom login form using Ajax
  29. Where Does WordPress Make cURL Requests? How To Add cURL Option
  30. How to give new users two specific user role options upon WordPress user registration
  31. Wp-login appears White Screen, Error: Cannot modify header information
  32. How to: PHP Log Out Link?
  33. Login/logout in header
  34. Why is my cookie not unsetting upon logout? [closed]
  35. User management system similar to wordpress one?
  36. export a csv file from the database with a cronjob
  37. Cannot access wp-admin/wp-login.php (WordPress backend) anymore, what could be wrong?
  38. How to debug my custom login form looping intermittently
  39. getting logged in user info (wp-load.php) from parent directory
  40. get post content of particular post by url
  41. Problem with login form
  42. Login to wordpress by clicking a link and specifying usernaname and password in url
  43. WordPress from url get external source title
  44. Log in / Log Out Custom Button
  45. Should `wp_login` be used since it’s deprecated?
  46. How to redirect users based on role and content of redirect_to?
  47. Change CSS based on is_user_logged_in
  48. How to display login form anywhere, when user isn’t logged in, without redirecting?
  49. How can I open up my administrative panel to everyone?
  50. How can I add a new row in a separate database when someone registers via WordPress?
  51. WordPress transient not working with WP Engine
  52. How to send a HTTP Post request using PHP Curl and WordPress
  53. One account with multiple logins
  54. Lost in trying to create user database system
  55. SOAP Request/Parsing XML From wp_send_json_success
  56. REST API works in browser and via AJAX but fails via cURL
  57. Shortcode to log user into current URL
  58. cURL error 6 on news area, and also won’t auto update
  59. PHP getting error when trying to access WP-Admin Dashboard
  60. I installed WordPress locally now how do I login?
  61. Post to WordPress from another Server via PHP
  62. If user is logged in not working
  63. Change homepage content if user is logged in – BuddyPress
  64. Accessing an API with jQuery and AJAX
  65. Show login greeting above sub-menu links?
  66. calling admin-ajax.php from admin-ajax.php
  67. is_user_logged_in returning nothing on custom page
  68. Help with accessing wp-admin page and resolving error messages
  69. Removing “There is no account with that username or email address.” error message in “/wp-login.php?action=lostpassword”
  70. Can’t log in to WordPress wp-admin after adding code to functions.php
  71. Check if user had autologin & if so, logout
  72. Admin Panel 404 Error after login
  73. PHP warning – Use of undefined constant ‘FORCE_SSL_LOGIN’ ‘FORCE_SSL_ADMIN’ on wp-config.php
  74. How to block specific user id in custom login form?
  75. Log out without confirmation request (nonce)
  76. Having trouble creating two shortcodes, one for logged in user and one for visitors
  77. Call WP Rest-Api to GET /users/me returned NOTHING in console
  78. Restrict wordpress access to logged users only
  79. Infinite loop when logging out using custom login form
  80. Menu not updating for logged in users after redirect
  81. how to use auth_redirect() redirect visitor to login page if they are not login when they click account and order page?
  82. Issues adding Recaptcha v3 to WordPress Registration
  83. Display specific page if user signed in
  84. Change Login or Logout text based on status
  85. Refresh page after login with litespeed cache
  86. Redirect after login depending on the URL
  87. Contactform7: display results from CURL
  88. Need help with AJAX login to call php in functions.php to handle redirects based on user cap (role)
  89. Redirecting the lost password page request when using a custon login page
  90. How do I send a POST request with params with WordPress REST API
  91. wp-login.php?redirect_to=https problem
  92. is_user_logged_in() not working in homepage
  93. Check if a user is logged into my WordPress site which is on a different server
  94. Newbie question. Login/Registration. New PHP page
  95. Adding a sidebar to wp-login.php
  96. List users in a dropdown for login
  97. Not logged in when using http
  98. add bootstrap modal after login in wordpress
  99. White screen after login attempt
  100. Redirect users not logged in to the standard login page (and back) from some posts and pages
Categories PHP Tags curl, login, php
Follow-up Comments Notification Without a Plug-in
How to link to theme options page from anywhere in admin?

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
  • Custom Elementor controls not appearing in the widget Advanced tab using injection hooks
  • Get the name of the template/*html file used
  • Trying to Add Paging to Single Post Page
  • Sharing media files between live and staging servers
  • How to display the description of a custom post type in the dashboard?
  • Critical error on image display
  • Copying WP data and files into new install?
  • How to determine the DirectAdmin WordPress backup date?
  • How to get list of ALL tables in the database?
© 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