Dear Sir/Madam,
Sorry for my late reply to below ticket, the ticket is now closed but I need further help.
https://toolset.com/forums/topic/conditional-not-work-after-redirect-page/#post-2011159
Please kind allow me to provide private message in next reply.
Best regards,
Kelvin.
Dear Sir/Madam,
Sorry, I can't wait for the solution as the site has to be launched.
I temporarily remove the condition and always show the button that the logged-in user should see.
I also add below code to troubleshoot the issue from the home page
<div style="display: none;">1. Current-user info id is [wpv-current-user info='id']</div>
[wpv-conditional evaluate="false" if="('[wpv-current-user info='id']' eq '')"]
<div style="display: none;">2. assume user is login. Current-user info id is [wpv-current-user info='id']</div>
[/wpv-conditional]
[wpv-conditional if="('[wpv-current-user info='id']' eq '')"]
<div style="display: none;">3. assume user is not login. Current-user info id is [wpv-current-user info='id']</div>
[/wpv-conditional]
I also add the above code to /my-applications/ page where the page will be redirected after login.
You may need to view the result using web inspector.
Below are the steps to replicate the issue:
1. login to the site /wp-login.php
2. /my-applications/ will be redirected, I can find the [wpv-current-user info='id'] value
3. click to /about/ and then home / , the [wpv-current-user info='id'] value is empty
4. click to /my-applications/, the [wpv-current-user info='id'] value is existed
5. click to home / again, the [wpv-current-user info='id'] value is empty again
6. reload the home /, the [wpv-current-user info='id'] value shows up
Initially, I guess the issue might be caused by the cache, I disable the cache plugin but the issue still exists.
Could you please help to investigate the issue why [wpv-current-user info='id'] so able to load until reload the home page?
Best regards,
Kelvin
Hello,
As your request, I have enabled the private message box, please provide your website credentials in it. thanks
I have tried these in your website with my chrome browser:
1) Login as user "toolset"
2) Edit the home page, add a shortcode block in the page bottom:
wpv-current-user ID: [wpv-current-user info='id']
2) Follow the steps you described in post:
https://toolset.com/forums/topic/conditional-not-work-after-redirect-page-cont/#post-2048723
In steps "5. click to home / again ..."
I can see the correct result without any problem, see my screenshot user-id.JPG
Is this problem resolved? it might be a browser cache problem, please try to clear your browser cache or try with another browser, and test again.
Dear Luo Yang,
I use Chrome Incognito Windows to test with below steps
1. Click 登入/註冊 from menu
2. Google login
3. Click the home page
I can't get the user id.
Best regards,
Kelvin
I have setup the shortcode block in your home page again:
hidden link
Please login your website with the same user "toolset" you provided above:
https://toolset.com/forums/topic/conditional-not-work-after-redirect-page-cont/#post-2051483
And test it using the steps you mentioned above:
https://toolset.com/forums/topic/conditional-not-work-after-redirect-page-cont/#post-2048723
I have double checked it in your website, it works fine.
Dear Luo Yang,
As the toolset account is an administrator role, it can't be simulated the same flow of the issue, I created an account toolsetuser as subscriber, password is same as toolset, I tested and issue found.
Step to test:
1. login as toolsetuser
2. click the Home
I have tried as you mentioned above, it works fine:
1) Login as user "toolsetuser"
2) Continue with my own Google account
3) click the Home
I can see correct user ID value: 10.
See my screenshot user-id-10.JPG
Dear Luo Yang,
Why you log in as a user 'toolsetuser' and then continue with your Google account? It should be either login as toolsetuser or google account, your steps were not the same as mine.
Best regards,
Kelvin.
Dear Luo Yang,
I don't know how to explain, I didn't get the current user id, I screen record the issue, hidden link
Please have a look.
I have tried the video record, but get 404 error, see my screenshot, please check it.
Dear Luo Yang,
Sorry for my careless, missing folder name, here you go hidden link
Best regards,
Kelvin
Thanks for the video, that is the browser cache problem, it occurs when user load the home page from the local browser cache instead of from your webserver, and can be fixed after user refresh browser.
You might consider to disable the browser cache of the home page, for example:
https://stackoverflow.com/questions/49547/how-do-we-control-web-page-caching-across-all-browsers
Dear Luo Yang,
I don't agree to request visitors to manually refresh or disable the browser cache. How can I force the page with the wpv-condition be reloaded? I don't understand why the page /my-applications/ has no such issue but only the home page?
Best regards,
Kelvin.