Topic-icon Invalid token and logs in and jumps to random page

Active Subscriptions:

None
Hello,

When I actually login with a username and password (not a social login) with any type of cache turned on I keep getting invalid token problems. Also when it does login it will just jump to a random page on the site most of the time?

Right now I have installed Jotcache and in the template told it not to cache the position the login module is in but the problem is still there.

Even Joomla conservative caching is causing problems.

It seems to work fine with Facebook and the other social logins this is just when people enter their username and password.

The site is www.boattreasure.com
Joomla 2.5

Everything is up to date.

Thanks
The topic has been locked.
Support Specialist
10 years 9 months ago #39514 by alzander

with any type of cache turned on I keep getting invalid token problems.

Can you test if you have the same behavior with the standard Joomla Login module (mod_login)? The SCLogin module is an improved version of that module, but the straight-up Joomla login portion was pretty much copied from the Joomla login module. That would be a great test to determine where problems are occurring.

Also when it does login it will just jump to a random page on the site most of the time?

If you have the redirection set to "Same Page" and then are caching the module, that would explain the behavior. Basically, a user is logging into the "Same Page" that the first user was on when the module was cached. I would recommend using a menu item redirect if you're caching solution is going to save the redirection like that.

Let me know about mod_login, and hopefully the above gives a good explanation of the cause and possible solutions.

Thanks,
Alex
The topic has been locked.
Active Subscriptions:

None
10 years 9 months ago - 10 years 9 months ago #39519 by master38851
I installed the Joomla login module in the bottom left of the site.

It works perfect without even removing it from cache.I still have Jotcache removing SCLogin.

I can use SClogin and get the invalid token error hit my back button and use the Joomla and it will login. The SClogin will not.

Any Ideas on this? The only way to make the SCLogin work is to turn off all cache.

EDIT: I should also point out the jomsocial login never has the problem. I also tried ScLogin in the same position as the Joomla login in the bottom left. That's using the same cache as the working Joomla login..

Thanks
Last edit: 10 years 9 months ago by master38851.
The topic has been locked.
Support Specialist
10 years 9 months ago #39544 by alzander
I'm unsure what's happening on your site. When I look at the output HTML, the session token for the SCLogin module is sometimes wrong. It seems like:
* If I'm the first to visit a page (it's not cached), the token is correct
* If the page has already been cached, the token sometimes is incorrect.

When you enable page caching (at least in Joomla), the following happens:
* Joomla caches the page the first time it's rendered
* When re-visited, the page is pulled out of cache
* Some code is run to see if there is an old token cached, and if so, replace it.

It seems like that check isn't working on the SCLogin module for some reason, and that's not something I can even guess why it would be. We do testing with page caching enabled, and know that many sites use page caching.. so something seems specific to your site.

The way we add the session token is the Joomla standard way. There's nothing special we're doing there to do so.

So, with all that said, my best guess is that it's a *page caching* issue, which is enabled whenever the System - Cache plugin is enabled. I'm not sure if JotCache does it's own page caching as well. Instead of fiddling with Conservative or Progressive caching, I'd try disabling the Page Caching options first.

Then, if that doesn't work, try Progressive Caching, as that would likely solve the issue.. though shouldn't be necessary.

Doing 'spot' caching through JotCache likely won't do anything since, if page caching is enabled, the whole page is cached. It won't matter if an individual module was skipped.

Keep me posted on the above. Would love to understand what's happening and help you resolve it.

Thanks,
Alex
The topic has been locked.
Active Subscriptions:

None
10 years 9 months ago - 10 years 9 months ago #39577 by master38851
Hello,

With all cache off it will login no problems. Works prefect.

I have already tried progressive cache but forgot to post. It also does not work.

If I have any cache at all turned on it will not work.

With any cache on I can get the invalid token problem hit my back button and then the Joomla or the jomsocial login will let you right in.

I have tried about everything I can think of to get this working. I really don't know what I have that is causing the problem but like I said all other logins work. The only one that does not is the SCLogin I need for JFBconnect.

I am leaving the site running with progressive cache on so you can see it also.

Thanks

EDIT: Also when I enable Joomla cache I disable Jotcache. I don't run them together. Right now the Joomla cache is running set to progressive.
Last edit: 10 years 9 months ago by master38851.
The topic has been locked.
Support Specialist
10 years 9 months ago #39594 by alzander
Do you have "System - Cache" plugin enabled? That plugin is separate from the caching settings in the Joomla Global Configuration area. The System - Cache plugin is what enables page caching, which can cause multiple different types of problems, though we haven't heard of any in the SCLogin module.

If that plugin is enabled, I'd recommend trying to disable it. For page caching to work, the system - cache plugin must be enabled *and* the caching configuration in the Global config area must be either Conservative or Progressive (not off). So, when you're enabling caching in the global config area, you may be enabling page caching and not realize it.

Test with System - Cache disabled and let me know if that gets things going. I honestly don't know why it would, but that's the first step to narrowing things down further.

Beyond that, the next steps would be for us to get into the admin area to see if there's something else we're missing.

Sorry for the confusion, but we'll get you going.

P.S. The SCLogin module isn't required for JFBConnect to function. It's just the easiest way to add the social login buttons to different parts of your site and has a lot more features over the standard Joomla login module.

Thanks,
Alex
The topic has been locked.
Active Subscriptions:

None
Yes I know about the plug in for cache. Like I said it works with cache turned off.

I have to disable and enable that plugin to turn jotcache turned on and off as well and the two jotcache plugins.

I would be more than happy to let you in the back end to look and see what you can find,

Let me know where to send the login info and I will send it.

Thanks
The topic has been locked.
Support Specialist
10 years 9 months ago #39607 by alzander
Sorry to repeat myself then. Most users don't know about the nuances of Joomla's caching, and the System - Cache plugin is generally a black hole for most users.

To send me credentials, please click the mail icon under my name to the left.

Thanks!
Alex
The topic has been locked.
Active Subscriptions:

None
Thanks for looking at this for me.

I sent you a PM
The topic has been locked.
Support Specialist
10 years 9 months ago #39635 by alzander
I just got into the site to look at things. I enabled Conservative caching and left the System - Cache plugin on. I was immediately able to recreate the error.

After some tests, I went into the SCLogin module and set Caching (in Advanced) to "Disabled". After that, I wasn't able to see the issue anymore. Additionally, the form action was properly set to the current page URL instead of always being the boat-services-directory.html file. I'm not sure why that was being set, but disabling the cache seemed to fix both things.

Obviously test some more, and try with JotCache, and let us know how that goes.

Thanks,
Alex
The topic has been locked.