Pergunta

So I have looked into the problem but it doesn't seem to have a solution in the Joomla forums.

logging out automatically

Keeps logging out

The issue I am getting is narrowed down to the URL. If the var &ID= is set in the URL it is okay, if not it logs out. In both cases I am doing a $_SESSION dump, and it confirms that the $user->id is set to 0. Don't know why it is logging out.

Any solutions are welcome, this is a problem that has been avoided for some time.

Foi útil?

Solução 3

Solution. I can only say for certain that this is the likely solution, but it should be helpful to people looking at this post.

There is a compatibility issue between legacy templates (1.0) in Joomla 1.5.x and the JUtility method getToken().

This is used in the login form apparently. So find it in the file and replace:

    <input type="hidden" name="<?php echo JUtility::getToken(); ?>" value="1" />

with:

    <input type="hidden" name="<?php echo JHTML::_( 'form.token' ); ?>" value="1" />

This is not the issue I was seeing, my issue was with the login, but with a registration component that makes much use of the JUtility::getToken() Class::method. I know that it is this as uninstalling the component solves the issue. However since I haven't tested any solutions within the component, I will not say absolutely that this is the solution.

Hope the post helps.
Thanks to those who answered.

Outras dicas

Wouldn't it be better to just leverage joomla's ablity to set menu items with an access level? Just set the level to "registered" and be done. Otherwise, if you're looking for a custom programmed solution, go into the controller that checks whether or not a user is logged in and then add a line to verify whether or not the ID is in the URL.

One thing is that you may seem like you are getting logged out but not actually be being logged out. So if you enter a url that should only be visible to logged in users you can still see it. In your session dump also set what user groups you are assigned to. Do they include guest? If so this could be the source of the problem; it was the subject of a recent fix in the platform.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top