Simple Membership Plugin › Forums › Simple Membership Plugin › Login Redirect Not Leaving users on same page
Tagged: login redirect
- This topic has 11 replies, 3 voices, and was last updated 8 years, 8 months ago by
nmac.
-
AuthorPosts
-
September 8, 2017 at 2:08 am #11925
nmac
ParticipantI’ve installed the login redirect plugin and followed the instructions of setting it up.
If I have an article that is completely protected, the login link at the bottom redirects back to the article where the user hits login. That works.
The problem is, I’m using the partial protect feature where the login message and link apparently does not pick up the redirect from the plugin.
I believe I might be able to get it working if I knew the parameters of using the:
swpm_redirect_to query
Is there any information on the usage of this?I followed this thread below, although the users proposed fix is not working for me. When I implement what he posted, the entire login message disappears.
<a href="http://mysite.co.uk/membership-login/?swpm_redirect_to=<?php echo get_permalink( $post->ID ); ?>">Log in</a>https://simple-membership-plugin.com/forums/topic/login-re-directs-to-homepage-need-to-just-refresh-current/Also, no matter if the page is fully protected or partially protected, the widget sidebar login does not bring the user back to the page where they logged in from. Is there any way to get that to recognize a redirect to the same page the user logged in from?
My goal is to have a user read a portion of an article. Then decide to login so he can continue reading the rest of the article, without having to manually navigate back to the article after login.
Thanks for the help, great plugin.
September 9, 2017 at 5:12 am #11932mbrsolution
ModeratorHi, are you talking about the following feature Enable More Tag Protection under General Settings tab?
Do you have any other addons installed?
Do you have the latest version of the addon and the plugin Simple Membership?
September 9, 2017 at 10:48 am #11936nmac
ParticipantThanks for responding.
I’m not talking about the More Tag Protection, I’m using “Simple Membership Partial Protection”.
I have the latest version and at this point I have additional add ons installed, but when I first encountered the problem I only had Partial Protection and the Redirect add on installed.
September 9, 2017 at 11:22 pm #11942mbrsolution
ModeratorThank you for reporting back. Just for testing purposes, can you disable all of your other plugins and only have this plugin and the partial protection addon. Then carry out a test? Report back with the outcome.
Regards
September 14, 2017 at 12:18 pm #11973nmac
ParticipantDisabling plugins didn’t change anything.
Is there any information on using the “swpm_redirect_to query”
If I can manually force the login links to pick up the variable of the redirect I think I could get it working. But I don’t know how the redirect query is being used in the base function.
I’d love to have this working properly.
ThanksSeptember 14, 2017 at 9:46 pm #11974mbrsolution
ModeratorHi, I have submitted a message to the developers to investigate further your issue.
Thank you
September 16, 2017 at 11:39 am #11979admin
KeymasterShow me the page where you have the following code:
<a href="http://mysite.co.uk/membership-login/?swpm_redirect_to=<?php echo get_permalink( $post->ID ); ?>">Log in</a>If you hover the mouse over that link, do you see the appropriate URL being added to the “swpm_redirect_to” query argument?
September 16, 2017 at 6:56 pm #11980nmac
ParticipantWhen that code is on the page, nothing shows up. The login prompt disappears.
[http://nickmacari.com/ac-test/]
September 17, 2017 at 2:10 am #11990admin
KeymasterI don’t know what is going on there unfortunately.
It is likely you are accessing the $post object outside the WordPress loop (where that object is not available).
This kind of custom help is beyond the scope of this free support forum. You will need to hire a developer (who is very familiar with WordPress coding) to deal with this kind of customization.
September 17, 2017 at 2:44 am #11993nmac
Participantoh that sucks.
My site is a stock site of the Moesia theme, no customization involved.
Thanks for responding though.
Is there any information anywhere on swpm_redirect_to query?
My guess is it’s something dumb, like the wrong character in the wrong place… If I knew what the base usage of it was on the default login I might be able to get it working.
Thanks
September 18, 2017 at 6:41 am #11995admin
KeymasterCreate a simple static link like the following on a test page (no coding at all… just hardcode this in a link):
http://mysite.co.uk/membership-login/?swpm_redirect_to=http://mysite.co.uk/some-page-urlThen click on it and test the login. You will see that it redirects to the page URL you specified in the “swpm_redirect_to” query parameter. That will prove to you that the query arg is working fine. Then it is a matter of figuring out why your code is not outputting a simple link like the one shown above.
I have tested the above functionality myself and I can verify that the login redirection works fine when a visitor goes to the login form with the after login URL value populated in the “swpm_redirect_to” query parameter.
September 23, 2017 at 6:51 pm #12009nmac
ParticipantThank you for giving that hardcode usage.
It’s solved my issue. -
AuthorPosts
- You must be logged in to reply to this topic.