Joomla! Discussion Forums



It is currently Sun Nov 08, 2009 11:54 am (All times are UTC )

 





Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 500 posts ]  Go to page 1, 2, 3, 4, 5 ... 17  Next
Author Message
Posted: Mon Jul 23, 2007 5:58 pm 
User avatar
Joomla! Guru
Joomla! Guru
Offline

Joined: Fri Aug 19, 2005 12:37 am
Posts: 945
Location: Washington, DC / NoVA
Description:
Clicking toolbar buttons in the backend other than 'save' or 'apply' results in being logged out when using Joomla! hosted on IIS.

Reported on:
1.0.13

Affected functions:
initSessionAdmin()

Related files:
includes/joomla.php

Steps to replicate:
Install Joomla 1.0.13 on an IIS webserver, then log in to the backend. Click on Add New Content, then click Cancel. You will then be returned back to the login screen with the message "You need to login." I am not able to reproduce this on Apache.

Proposed fix(es):
$session_id is matching the md5 hash generated on line 771, but then we end up in the block where the old session is removed and a new session id is generated. Could it be that the session is destroyed and the browser is redirected before a new one is created?

System info:
PHP built On:  Windows NT ATOCAPP30 5.0 build 2195
Database Version: 5.0.41-community-nt
PHP Version: 5.1.4
Web Server: Microsoft-IIS/5.0
WebServer to PHP interface: cgi-fcgi
Joomla! Version: Joomla! 1.0.13 Stable [ Sunglow ] 21 July 2007 16:00 UTC
User Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.5) Gecko/20070713 Firefox/2.0.0.5
Relevant PHP Settings:
Joomla! Register Globals Emulation: OFF
Register Globals: OFF
Magic Quotes: ON
Safe Mode: OFF
File Uploads: ON
Session auto start: OFF
Session save path: D:\PHP\sessiondata
Short Open Tags: ON
Output Buffering: OFF
Open basedir: none
Display Errors: ON
XML enabled: Yes
Zlib enabled: Yes
Disabled Functions: none



Session configuration from phpinfo:

Session Support enabled
Registered save handlers files user
Registered serializer handlers php php_binary wddx

Directive Local Value Master Value
session.auto_start Off Off
session.bug_compat_42 On On
session.bug_compat_warn On On
session.cache_expire 180 180
session.cache_limiter nocache nocache
session.cookie_domain no value no value
session.cookie_lifetime 0 0
session.cookie_path / /
session.cookie_secure Off Off
session.entropy_file no value no value
session.entropy_length 0 0
session.gc_divisor 100 100
session.gc_maxlifetime 18000600 1440
session.gc_probability 1 1
session.hash_bits_per_character 4 4
session.hash_function 0 0
session.name 55e9073d3573b2d22a51f573877f72ed PHPSESSID
session.referer_check no value no value
session.save_handler files files
session.save_path D:\PHP\sessiondata D:\PHP\sessiondata
session.serialize_handler php php
session.use_cookies On On
session.use_only_cookies Off Off
session.use_trans_sid 0 0

Edit: added better system information and clarified that this problem does not occur on Apache.
Edit 2: added session configuration information from phpinfo.
Edit 3: changed topic heading, as this issue is experienced across platforms.

_________________
Joseph L. LeBlanc: http://www.jlleblanc.com
Frontend components start here: /components/com_[name]/[name].php
Backend components start here: /administrator/components/com_[name]/admin.[name].php


Last edited by Robin on Sat Aug 11, 2007 9:49 am, edited 1 time in total.

Top
   
 
Posted: Tue Jul 24, 2007 10:26 am 
User avatar
Joomla! Guru
Joomla! Guru
Offline

Joined: Fri Aug 19, 2005 5:23 pm
Posts: 553
Location: Gogledd Cymru
This is a serious issue and makes the admin interface pretty much unusable.  By the way I am seeing this problem Apache 2.0.54 with PHP 5.2.3 running on a windows server.

Geraint

p.s. I posted a bug report on Joomlacode about session_id problems before 1.0.13 was released but it was not fixed

[edit : added server config]

_________________
email: opensourcematters at copynDOTplusDOTcom


Last edited by Geraint on Tue Jul 24, 2007 10:52 am, edited 1 time in total.

Top
  E-mail  
 
Posted: Tue Jul 24, 2007 11:13 am 
User avatar
Joomla! Guru
Joomla! Guru
Offline

Joined: Fri Aug 19, 2005 5:23 pm
Posts: 553
Location: Gogledd Cymru
Some insights (and a fix?)

The problem arises if you have a component that doesn't use a mosRedirect at the end of processing a 'save' or 'apply' task.  You can simulate the problem by commenting out the mosRedirct at line 789 in admin.content.php and then saving some content.

This is the warning you get:

Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at C:\Documents and Settings\Geraint\Documents\joomlacode\Joomla1.0.x\includes\joomla.php:4145) in C:\Documents and Settings\Geraint\Documents\joomlacode\Joomla1.0.x\includes\joomla.php on line 800

This is caused by an attempt to set the session cookie (in initSessionAdmin) after the headers have already been sent via the doGzip() at the end of index2.php.  If you put the doGzip right at the end of the file (AFTER the call to $mainframe->initSessionAdmin( $option, '' );) then everything works.

Geraint

_________________
email: opensourcematters at copynDOTplusDOTcom


Top
  E-mail  
 
Posted: Wed Jul 25, 2007 7:31 am 
User avatar
Joomla! Explorer
Joomla! Explorer
Offline

Joined: Thu Aug 18, 2005 9:19 am
Posts: 380
Location: Peterborough, UK
The way I fixed this on my component was to add a line at the end of my toolbar.php file to clear the $task variable like so:

Code:
$task = ""; //Have to clear it, otherwise Joomla tries to start a new session (as of 1.0.13)

_________________
Netshine Software Limited
www.netshinesoftware.com


Top
  E-mail  
 
Posted: Wed Jul 25, 2007 7:56 am 
User avatar
Joomla! Guru
Joomla! Guru
Offline

Joined: Fri Aug 19, 2005 5:23 pm
Posts: 553
Location: Gogledd Cymru
That isn't quite enough - I have to set

$GLOBALS["task"]="";
$_REQUEST["task"]="";

at the end of the component.

Geraint

p.s. Having said that the problem is caused by the fact the Joomla 1.0.13 is failing to set the new session cookie

_________________
email: opensourcematters at copynDOTplusDOTcom


Top
  E-mail  
 
Posted: Wed Jul 25, 2007 9:06 am 
User avatar
Joomla! Explorer
Joomla! Explorer
Offline

Joined: Thu Aug 18, 2005 9:19 am
Posts: 380
Location: Peterborough, UK
Yes, of course that assumed the $task variable was registered with "global $task" earlier in the script (which it typically would be in a toolbar file). Clearing it at the end of the component file was not enough because the toolbar file was called afterwards, and still needed to know the value of $task.

_________________
Netshine Software Limited
www.netshinesoftware.com


Top
  E-mail  
 
Posted: Wed Jul 25, 2007 9:41 am 
User avatar
Joomla! Guru
Joomla! Guru
Offline

Joined: Fri Aug 19, 2005 5:23 pm
Posts: 553
Location: Gogledd Cymru
I had to set the REQUEST value too because some admin modules etc. reset the global $task after the toolbar and component was called.

Anyhow the point is - its Joomla 1.0.13 that should be fixed since there are no trivial universal workarounds.

_________________
email: opensourcematters at copynDOTplusDOTcom


Top
  E-mail  
 
Posted: Wed Jul 25, 2007 9:47 am 
User avatar
Joomla! Master
Joomla! Master
Offline

Joined: Thu Aug 18, 2005 10:41 am
Posts: 15089
Geraint,

Thanks for all the info on this bug. To make sure, I'll try to replicate on a IIS webserver asap, but without a doubt I will probably be able to replicate the issues.

_________________
Regards Robin


Top
   
 
Posted: Wed Jul 25, 2007 10:40 am 
User avatar
Joomla! Guru
Joomla! Guru
Offline

Joined: Fri Aug 19, 2005 5:23 pm
Posts: 553
Location: Gogledd Cymru
Thanks Rob

Just to confirm - I am seeing this problem in Apache (running on a windows server)

Geraint

_________________
email: opensourcematters at copynDOTplusDOTcom


Top
  E-mail  
 
Posted: Wed Jul 25, 2007 3:48 pm 
Joomla! Fledgling
Joomla! Fledgling
Offline

Joined: Wed Jul 25, 2007 3:46 pm
Posts: 2
Hi all,

I have some problem on Apache and Linux Fedora 4

Tanks


Top
  E-mail  
 
Posted: Wed Jul 25, 2007 6:37 pm 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Thu Aug 18, 2005 8:40 am
Posts: 28
this problem also arises in 3rd party component like virtuemartand joomfish.

for those of us who upgraded too soon...could you give us an advice what to do until this has been fixed? someone has reported that uploading the old joomla.php file gets rid of the warning and the admin is not going to get kicked out.

thx for any tips.


Top
   
 
Posted: Wed Jul 25, 2007 6:56 pm 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Mon Oct 24, 2005 1:36 am
Posts: 37
This problem also apparent on OS X Server 10.4.10 and Apache 1.3 running PHP 4.4.4.  Also apparent on Fedora 6 and Apache 2.0 running PHP 4 & 5.  Certainly isn't platform independent!


Top
  E-mail  
 
Posted: Wed Jul 25, 2007 6:57 pm 
Joomla! Intern
Joomla! Intern
Offline

Joined: Wed Oct 05, 2005 5:10 pm
Posts: 74
make test on separate  folder and read all post you can

after some time  upgrade


Last edited by pippo on Wed Jul 25, 2007 7:20 pm, edited 1 time in total.

Top
   
 
Posted: Wed Jul 25, 2007 7:01 pm 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Mon Oct 24, 2005 1:36 am
Posts: 37
pippo wrote:
never upgrade soon

make test on separate  folder and read all post you can

after some time   upgrade



So what do you do if you are starting a server from scratch?  Use an old version?  I think not.  If the release is launched as 'Stable' it shouldn't really be as stable as a jelly in a hurricane.....


Top
  E-mail  
 
Posted: Wed Jul 25, 2007 7:18 pm 
Joomla! Intern
Joomla! Intern
Offline

Joined: Wed Oct 05, 2005 5:10 pm
Posts: 74
sgreen wrote:
So what do you do if you are starting a server from scratch?  Use an old version?  I think not.  If the release is launched as 'Stable' it shouldn't really be as stable as a jelly in a hurricane.....


I agree you    but as you can see  it seem no


Top
   
 
Posted: Wed Jul 25, 2007 8:09 pm 
User avatar
Joomla! Enthusiast
Joomla! Enthusiast
Offline

Joined: Mon Aug 29, 2005 10:58 am
Posts: 109
Location: Germany
Well,
VirtueMart is also affected by this bug.
The problem is indeed a wrong order of the calls to initSessionAdmin and doGzip at the end of the file /administrator/index2.php.
If we change

BEFORE
Code:
103      doGzip();
104      
105      // if task action is 'save' or 'apply' redo session check
106      if ( $task == 'save' || $task == 'apply' ) {
107         $mainframe->initSessionAdmin( $option, '' );
108      }


to
Code:
102      // if task action is 'save' or 'apply' redo session check
103      if ( $task == 'save' || $task == 'apply' ) {
104         $mainframe->initSessionAdmin( $option, '' );
105      }
106      doGzip();

the problem is gone.

I have posted a Hotfix for Joomla! 1.0.13 on the VirtueMart Homepage.
Feel free to try it. It just contains the updated index2.php file.

ciao, Sören

_________________
VirtueMart Lead Developer
Other projects: eXtplorer & joomlaXplorer, DocBook:Collab


Top
  E-mail  
 
Posted: Wed Jul 25, 2007 8:13 pm 
Joomla! Fledgling
Joomla! Fledgling
Offline

Joined: Wed Jul 25, 2007 3:46 pm
Posts: 2
soeren,

Very, very, very tanks!

My VirtueMart Admin already working fine :)

Tanks again


Top
  E-mail  
 
Posted: Wed Jul 25, 2007 8:14 pm 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Thu Aug 18, 2005 8:40 am
Posts: 28
soeren wrote:
the problem is gone.


Hello Sören,

thx for the hotfix. dont know if you have seen this threadon virtuemart.net but there are a couple of people who get kicked out after they log in as admin.


Top
   
 
Posted: Wed Jul 25, 2007 8:16 pm 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Thu Aug 18, 2005 8:40 am
Posts: 28
pavini wrote:
My VirtueMart Admin already working fine :)


Hello Pavini,

you reported the same problem on the vm forum. would you mind telling us what you did because its not working here.

thx.


Top
   
 
Posted: Wed Jul 25, 2007 8:19 pm 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Thu Aug 18, 2005 8:40 am
Posts: 28
ok. there was a second hotfix regarding the admin session.

thx Soeren!


Top
   
 
Posted: Wed Jul 25, 2007 8:27 pm 
User avatar
Joomla! Guru
Joomla! Guru
Offline

Joined: Fri Aug 19, 2005 12:37 am
Posts: 945
Location: Washington, DC / NoVA
The hotfix doesn't work on my end. Fortunately, I'm only testing this on a dev site for the moment. Thanks for your work though, Sören (both now and for the past several years!).

_________________
Joseph L. LeBlanc: http://www.jlleblanc.com
Frontend components start here: /components/com_[name]/[name].php
Backend components start here: /administrator/components/com_[name]/admin.[name].php


Top
   
 
Posted: Wed Jul 25, 2007 8:33 pm 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Thu Aug 18, 2005 8:40 am
Posts: 28
Quote:
Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at C:\Documents and Settings\Geraint\Documents\joomlacode\Joomla1.0.x\includes\joomla.php:4145) in C:\Documents and Settings\Geraint\Documents\joomlacode\Joomla1.0.x\includes\joomla.php on line 800


we can confirm that Soerens second admin hotfix let us 1) save and 2) stay logged in in the admin backend and (3) gets rid of the warning.


Top
   
 
Posted: Wed Jul 25, 2007 9:55 pm 
User avatar
Joomla! Guru
Joomla! Guru
Offline

Joined: Fri Aug 19, 2005 5:23 pm
Posts: 553
Location: Gogledd Cymru
soeren wrote:
VirtueMart is also affected by this bug.
The problem is indeed a wrong order of the calls to initSessionAdmin and doGzip at the end of the file /administrator/index2.php.


Hi Soeren

There appears to be consensus that initSessionAdmin will not work if its called after doGzip (since the session cookie cannot be set after the headers are sent to the browser).  As a member of the Q&T team, can you get the problem resolved and a repackaged version of 1.0.13 (or 14) released asap?

Geraint

_________________
email: opensourcematters at copynDOTplusDOTcom


Top
  E-mail  
 
Posted: Thu Jul 26, 2007 9:50 pm 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Mon Oct 24, 2005 1:36 am
Posts: 37
soeren wrote:
The problem is indeed a wrong order of the calls to initSessionAdmin and doGzip at the end of the file /administrator/index2.php.
the problem is gone.


Doesn't cure the problem at this end.  Having made the change, the problem is still apparent.  This is found on both Safari and Firefox on the Mac.


Top
  E-mail  
 
Posted: Fri Jul 27, 2007 6:40 am 
User avatar
Joomla! Guru
Joomla! Guru
Offline

Joined: Fri Aug 19, 2005 5:23 pm
Posts: 553
Location: Gogledd Cymru
sgreen wrote:

Doesn't cure the problem at this end.  Having made the change, the problem is still apparent.  This is found on both Safari and Firefox on the Mac.


If you set display_errors on and the error reporting level to E_ALL do you get any error messages? 

And just to double check - the problem the change fixes is just the auto logout behaviour not the authentication problem for bridges and other components.

Geraint

_________________
email: opensourcematters at copynDOTplusDOTcom


Top
  E-mail  
 
Posted: Fri Jul 27, 2007 7:45 am 
User avatar
Joomla! Master
Joomla! Master
Offline

Joined: Thu Aug 18, 2005 10:41 am
Posts: 15089
Geraint wrote:
soeren wrote:
VirtueMart is also affected by this bug.
The problem is indeed a wrong order of the calls to initSessionAdmin and doGzip at the end of the file /administrator/index2.php.


Hi Soeren

There appears to be consensus that initSessionAdmin will not work if its called after doGzip (since the session cookie cannot be set after the headers are sent to the browser).  As a member of the Q&T team, can you get the problem resolved and a repackaged version of 1.0.13 (or 14) released asap?

Geraint


Geraint,

RobS is looking into the issue, as developer. I would be the one to initiate a 1.0.14 release but I want to wait untill I have some feedback from Rob first.

Edit; talked to Rob briefly, he will be looking at the issue in the next few days and will report back to me.

_________________
Regards Robin


Last edited by Robin on Fri Jul 27, 2007 7:54 am, edited 1 time in total.

Top
   
 
Posted: Mon Jul 30, 2007 10:21 pm 
User avatar
Joomla! Guru
Joomla! Guru
Offline

Joined: Fri Jun 30, 2006 5:20 am
Posts: 777
Location: México, D.F.
I have the same problem with Joomap 2.05 :(

_________________
[ Abajo y a la Izquierda esta el corazón. ]
˜”*°•˜ http://www.guiasjoomla.com/ ˜•°*”˜
[ Joomla Latino ]


Top
  E-mail  
 
Posted: Tue Jul 31, 2007 6:11 am 
User avatar
Joomla! Guru
Joomla! Guru
Offline

Joined: Sat Nov 12, 2005 10:55 pm
Posts: 842
Location: Israel
merolhack wrote:
I have the same problem with Joomap 2.05 :(

Can you please try soeren up here?
Let us know..

_________________
"In a world without walls and fences,
who needs Windows & Gates?"

http://www.smartmtk.com | http://www.lighthost.co.il/webhosting-for-joomla


Top
   
 
Posted: Tue Jul 31, 2007 9:12 am 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Thu Mar 30, 2006 10:55 am
Posts: 44
merolhack wrote:
I have the same problem with Joomap 2.05 :(


Try the hot fix Soeren posted (see above) I have also seen a fault, in Joomap as soon as you save you get logged off from Joomla administrator.  after I replaced the file from the hot fix
the save error resolved. (testing Joomla 1.0.13 on a Fedora Core machine)

It did not resolve the problem I’m having with Sef patch Advanced. As soon as I go to components – Sef patch Advanced and click on a configuration item two of the three times I get logged of completely. Spoke to the developer but came to the conclusion the it is not in his package.


Top
  E-mail  
 
Posted: Tue Jul 31, 2007 9:13 am 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Thu Mar 30, 2006 10:55 am
Posts: 44
althoffm wrote:
merolhack wrote:
I have the same problem with Joomap 2.05 :(


Try the hot fix Soeren posted (see above) I have also seen a fault, in Joomap as soon as you save you get logged off from Joomla administrator.  after I replaced the file from the hot fix the save error resolved. (testing Joomla 1.0.13 on a Fedora Core machine)

It did not resolve the problem I’m having with Sef patch Advanced. As soon as I go to components – Sef patch Advanced and click on a configuration item two of the three times I get logged of completely. Spoke to the developer but came to the conclusion the it is not in his package.



Top
  E-mail  
 
Display posts from previous:  Sort by  
Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 500 posts ]  Go to page 1, 2, 3, 4, 5 ... 17  Next

Quick reply

 



Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group