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

Not logged in when using http

Users which have logged-in via https should always be served content via https otherwise there is no point in having the login form use https at all. With http anyone can intercept the cookie and use it to get to the users’s account without even knowing the user and password.

The question here is probably why a logged in user is presented with an http link at all. A way around it might be to detect when the LOGGED_IN_COOKIE cookie is set, and it should be available on http as well as https, and if it is set redirect to https.

Clarification: you don’t have to serve everything over https for logged in user, it is just a simpler path to follow IMO. The harder approach is to require login only on pages in which you actually display confidential information to the user but then if your user have the admin bar turned off you can serve the page as http but if it is on you need to go https.

If all you do is to display the user display name and it is a public information then you can derive the user info from the login name which is contained in the LOGGED_IN_COOKIE cookie, but for actual authentication you need to go https.

Related Posts:

  1. How can I force users to access my page over HTTPS instead of HTTP?
  2. Setting $_SERVER[‘HTTPS’]=’on’ prevents access to wp-admin
  3. PHP warning – Use of undefined constant ‘FORCE_SSL_LOGIN’ ‘FORCE_SSL_ADMIN’ on wp-config.php
  4. Chrome net::ERR_INCOMPLETE_CHUNKED_ENCODING error
  5. How do you redirect HTTPS to HTTP?
  6. How to force Laravel Project to use HTTPS for all routes?
  7. User registration followed by automatic login
  8. Adding “Remember Me” in custom login
  9. cURL 28 error after switch from to brew php 7.2 on localhost
  10. How to change the wp-login.php page title?
  11. How build a custom login/register form with error handling?
  12. How to run multiple Async HTTP requests in WordPress?
  13. WP CLI info showing correct PHP binary but wrong version of PHP
  14. Does the debug.log do log rotation?
  15. Change the footer text on the login page
  16. Changing user_nicename
  17. WordPress 4 invalid username special charachters issue
  18. How to place login logout link on menu that redirects users back to current page?
  19. How to turn off redirection from ‘domain.com/login’ to ‘domain.com/wp-login.php’
  20. How to resolve error “Cookies are blocked due to unexpected output.”?
  21. Using a nonce in a Custom Login Form
  22. Constructing a custom login form using ajax
  23. automated tests as a user?
  24. Remove username in emails or swap username for email
  25. apache cpu over 70% on localhost
  26. woocommerce and is_user_logged_in() if not redirect to homepage
  27. Is it possible to move wordpress out of webroot?
  28. login wp impossible
  29. wp-admin/index.php gives a “500 Internal Server Error [closed]
  30. Check if user is logged in when clicking certain links on certain pages
  31. Memory errors with media upload, WordPress can’t use more than 96M (while there’s 512 available!)
  32. PHP If user is logged in & on home page redirect
  33. WordPress shows registration link for non logged users
  34. Creating login session via CURL
  35. Force SSL using FORCE_SSL_ADMIN
  36. Admin username and password
  37. Evaluations of two wordpress security plans against php code injection attack
  38. WordPress (3.9.1) MultiSite Permissions. Is chown the answer?
  39. Recovering WP Login Credintials in Code?
  40. Is it necessary to sanitize wp_set_password user input?
  41. Is XAMPP faster than running LAMP in WSL on Windows 10? [closed]
  42. WordPress custom login form using Ajax
  43. Apache /Ubuntu server not running WordPress installation, outputting PHP code like HTML
  44. How to give new users two specific user role options upon WordPress user registration
  45. Apache Fallback instead of add_rewrite_rule
  46. Wp-login appears White Screen, Error: Cannot modify header information
  47. How to: PHP Log Out Link?
  48. Login/logout in header
  49. Why is my cookie not unsetting upon logout? [closed]
  50. User management system similar to wordpress one?
  51. WordPress: get recent posts, delete the current category
  52. PHP Warning: chmod(): Operation not permitted in class-wp-filesystem-direct.php on line 173
  53. Chrome 83 doesn’t connect WP login page after update from http to https on localhost
  54. Programmatic Login from 3rd Party site
  55. Cannot access wp-admin/wp-login.php (WordPress backend) anymore, what could be wrong?
  56. WordPress admin dashboard missing icons
  57. WordPress returning 404 for multisite pages
  58. How to debug my custom login form looping intermittently
  59. How can I fix the mixed content problems of the kk star ratings plugin?
  60. how to combine wordpress htaccess on my root domain + php on subfolder
  61. getting logged in user info (wp-load.php) from parent directory
  62. How to disable server signature on wordpress? [closed]
  63. Posting and image insertion problems after EasyApache4 and PHP 7 upgrade
  64. Problem with login form
  65. Login to wordpress by clicking a link and specifying usernaname and password in url
  66. Log in / Log Out Custom Button
  67. Call to undefined function mysql_connect() After upgrading PHP 7.1 to 7.3
  68. Should `wp_login` be used since it’s deprecated?
  69. How to redirect users based on role and content of redirect_to?
  70. Change CSS based on is_user_logged_in
  71. How to display login form anywhere, when user isn’t logged in, without redirecting?
  72. How can I open up my administrative panel to everyone?
  73. How does WP work in conjunction with a web server?
  74. How can I add a new row in a separate database when someone registers via WordPress?
  75. Permalinks are not working in WordPress in digitalocean
  76. One account with multiple logins
  77. Lost in trying to create user database system
  78. Gravatar image url is wrong?
  79. https to https problem – 404 and can’t login
  80. Shortcode to log user into current URL
  81. PHP getting error when trying to access WP-Admin Dashboard
  82. Apache HTTP Server stops working for only a certain local website
  83. I installed WordPress locally now how do I login?
  84. If user is logged in not working
  85. Change homepage content if user is logged in – BuddyPress
  86. https and wordpress breaks posts
  87. Show login greeting above sub-menu links?
  88. is_user_logged_in returning nothing on custom page
  89. Help with accessing wp-admin page and resolving error messages
  90. Problem with data collection in tables
  91. Removing “There is no account with that username or email address.” error message in “/wp-login.php?action=lostpassword”
  92. Can’t log in to WordPress wp-admin after adding code to functions.php
  93. Check if user had autologin & if so, logout
  94. Admin Panel 404 Error after login
  95. How to block specific user id in custom login form?
  96. Log out without confirmation request (nonce)
  97. Having trouble creating two shortcodes, one for logged in user and one for visitors
  98. Call WP Rest-Api to GET /users/me returned NOTHING in console
  99. Restrict wordpress access to logged users only
  100. Infinite loop when logging out using custom login form
Categories PHP Tags apache, https, login, php, ssl
Theme stops media uploader from working
New multisite redirects to main site

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