Page 1 of 1

Your session has expired. Please log in again

Posted: Sat Jan 10, 2009 5:47 pm
by Oleg-A
If I login->logout and then try to login again, an error message appears:

Code: Select all

Your session has expired. Please log in again
this errors appears as well as on the simple login (sometimes).
This problem came after the upgrade from 1.5.8 to 1.5.9

SQL queries from the page with "Your session expired" error (tried to login from frontend):

Code: Select all

#
SELECT *
  FROM sh10_session
  WHERE session_id = 'b9f73d4d950af5f43621a41f78082d5e'
#
DELETE
  FROM sh10_session
  WHERE ( time < '1231608598' )
#
SELECT *
  FROM sh10_session
  WHERE session_id = 'b9f73d4d950af5f43621a41f78082d5e'
#
UPDATE `sh10_session`
  SET `time`='1231609498',`userid`='0',`usertype`='',`username`='',`gid`='0',`guest`='1',`client_id`='0',`data`='__default|a:9:{s:15:\"session.counter\";i:1;s:19:\"session.timer.start\";i:1231609498;s:18:\"session.timer.last\";i:1231609498;s:17:\"session.timer.now\";i:1231609498;s:22:\"session.client.browser\";s:81:\"Mozilla/5.0 (X11; U; Linux x86_64; ru; rv:1.9.0.5) Gecko/2008122115 Firefox/3.0.5\";s:8:\"registry\";O:9:\"JRegistry\":3:{s:17:\"_defaultNameSpace\";s:7:\"session\";s:9:\"_registry\";a:1:{s:7:\"session\";a:1:{s:4:\"data\";O:8:\"stdClass\":0:{}}}s:7:\"_errors\";a:0:{}}s:4:\"user\";O:5:\"JUser\":19:{s:2:\"id\";i:0;s:4:\"name\";N;s:8:\"username\";N;s:5:\"email\";N;s:8:\"password\";N;s:14:\"password_clear\";s:0:\"\";s:8:\"usertype\";N;s:5:\"block\";N;s:9:\"sendEmail\";i:0;s:3:\"gid\";i:0;s:12:\"registerDate\";N;s:13:\"lastvisitDate\";N;s:10:\"activation\";N;s:6:\"params\";N;s:3:\"aid\";i:0;s:5:\"guest\";i:1;s:7:\"_params\";O:10:\"JParameter\":7:{s:4:\"_raw\";s:0:\"\";s:4:\"_xml\";N;s:9:\"_elements\";a:0:{}s:12:\"_elementPath\";a:1:{i:0;s:60:\"/www/sh10/www/htdocs/libraries/joomla/html/parameter/element\";}s:17:\"_defaultNameSpace\";s:8:\"_default\";s:9:\"_registry\";a:1:{s:8:\"_default\";a:1:{s:4:\"data\";O:8:\"stdClass\":0:{}}}s:7:\"_errors\";a:0:{}}s:9:\"_errorMsg\";N;s:7:\"_errors\";a:0:{}}s:13:\"session.token\";s:32:\"2710328ebdf339b94779a53e0473dc32\";s:17:\"application.queue\";a:1:{i:0;a:2:{s:7:\"message\";s:97:\"Your session has expired. Please log in again\";s:4:\"type\";s:7:\"message\";}}}'
  WHERE session_id='b9f73d4d950af5f43621a41f78082d5e'
If I refresh the page, everything works ok.

Re: Your session has expired. Please log in again

Posted: Sun Jan 11, 2009 12:29 am
by dpacadmin
Are you using the default Joomla login module or some other login? Are you having any other problems with your site? Are you using the Joomla cache setting? Have you tried a different browser or deleting your browser's temp files?

Re: Your session has expired. Please log in again

Posted: Sun Jan 11, 2009 8:14 am
by Oleg-A
I use default login module.
Cache is disabled.
I tried with two different browsers with deleting all browser's temp files.

There was another problem after the upgrade to 1.5.9:
after login, there are no redirection to the previous page, instead of this, it shows the page with "User Details".
I found solution on this forum:
in components/com_user/controller.php, comment or remove:

Code: Select all

if(!JError::isError($error))
		{
			// Redirect if the return url is not registration or login
			if ( ! $return ) {
				$return	= 'index.php?option=com_user';
			}

			$mainframe->redirect( $return );
		}
		else
		{
			// Facilitate third party login forms
			if ( ! $return ) {
				$return	= 'index.php?option=com_user&view=login';
			}

			// Redirect to a login form
			$mainframe->redirect( $return );
		}
after, add

Code: Select all

$jackieURL =& JFactory::getURI();
$jackieURL = $jackieURL->toString();
$mainframe->redirect($jackieURL);

Re: Your session has expired. Please log in again

Posted: Sat Dec 04, 2010 12:28 am
by zbabyface
This didn't work for me....

I do have a 3rd party login / log out... things have gotten kinda complex.... :)

Logout Button appears on menu as option
When person presses logout, it automatically logs out the user and then sends them to:

http://thefamilyunitpg.com/index.php?op ... ask=logout

Then I have metamod(login module) , when the user logs in I'm getting an error:
* Your session has expired. Please log in again.

Registered Area
Welcome!
Welcome to the registered user area of our site.

1.5.22
Jomsocial
Metamod
rokbox

any suggestions would be great!

Re: Your session has expired. Please log in again

Posted: Sat Dec 04, 2010 12:20 pm
by harrel
Go to global configuration and select session handler to none

Re: Your session has expired. Please log in again

Posted: Mon Dec 20, 2010 9:20 pm
by zbabyface
harrel wrote:Go to global configuration and select session handler to none
Didn't work either...

Re: Your session has expired. Please log in again

Posted: Tue Dec 28, 2010 9:38 am
by lucausa75
harrel wrote:Go to global configuration and select session handler to none

Until now it worked for me!

Re: Your session has expired. Please log in again

Posted: Thu Feb 24, 2011 2:54 am
by alexandrecintra
After to look for several solutions, I decided to analise the joomla source and I hacked the core. It works for me.

Insert at begin of the method checkToken found at libraries/joomla/environment/request.php

Code: Select all

        if (JRequest::getCmd("option")=="com_user" && JRequest::getCmd("task")=="login") {
            return true;
        }
What does this method do?

It just skip to check the token when the user is authenticating.

I don't know why it doesn't recover the token. I need to study more this code.

I'm not sure it it's a good solution.

Regards

Re: Your session has expired. Please log in again

Posted: Mon Apr 11, 2011 3:29 pm
by bashkimi
Have this problem as well. Sometimes I cannot login from front-end. It shows "You're not authorized to view this resource" and then "Please Login or Register".

Just when I close all browsers and open again, I am able to login.

When it happens, I can see that In degub mode, the session is invalid or whatever. It shows similar to the one on this topic

"SET `time`='1231609498',`userid`='0',`usertype`='',`username`='',`gid`='0',`guest`='1',`client_id`='0',`data`='__default|a:9:{s .... "

Re: Your session has expired. Please log in again

Posted: Mon Aug 29, 2016 10:50 pm
by sanjud8209
Check the .htaccess file and remove the bellow codes
Or just rename your .htaccess to htaccess.txt

RewriteCond %{REQUEST_URI} ^/index\.php/
RewriteRule ^index.php/(.*) /$1 [R,L]

This solve my issue