Must be logged in when adding images to entries. [SOLVED]

Found a bug? Tell us!!
Post Reply
leonardb
Regular
Posts: 53
Joined: Fri Jan 14, 2005 10:27 pm

Must be logged in when adding images to entries. [SOLVED]

Post by leonardb »

When making an entry and trying to add images i get the error.

"You have to be logged in to view this page

i'm obviously logged in as i'm making an entry :)

any help is appreciated..
Last edited by leonardb on Sat Jan 15, 2005 6:57 pm, edited 1 time in total.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Must be logged in when adding images to entries.

Post by garvinhicking »

It seems your PHP sessions are wrongly configured. Check all session relevant settings (especially session.save_path) and check your phpinfo() output to see that sessions are enabled. Also make sure your browser supports cookies.

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
leonardb
Regular
Posts: 53
Joined: Fri Jan 14, 2005 10:27 pm

Re: Must be logged in when adding images to entries.

Post by leonardb »

garvinhicking wrote:It seems your PHP sessions are wrongly configured. Check all session relevant settings (especially session.save_path) and check your phpinfo() output to see that sessions are enabled. Also make sure your browser supports cookies.

Regards,
Garvin
From the phpinfo output

Session Support enabled

session.name PHPSESSID PHPSESSID


session.save_path /tmp /tmp (path does exist)

thanks for the help.. cookies are enabled.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Must be logged in when adding images to entries.

Post by garvinhicking »

Is your /tmp path world-writable? Which Linux/Unix are you using, and which PHP version?
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
leonardb
Regular
Posts: 53
Joined: Fri Jan 14, 2005 10:27 pm

Re: Must be logged in when adding images to entries.

Post by leonardb »

garvinhicking wrote:Is your /tmp path world-writable? Which Linux/Unix are you using, and which PHP version?
path is world writtable

using Gentoo Linux

PHP= PHP/4.3.10

thanks..
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Must be logged in when adding images to entries.

Post by garvinhicking »

Please save this file as test.php and execute it:

Code: Select all

<?php
session_start();
$_SESSION['dummy'] = time();
?>
<html><body>
<?php
if ($_GET['output'] == 'true') {
    echo 'DUMMY IS: ' . $_SESSION['dummy'];
} else {
    echo '<a href="#" onclick="window.open(\'test.php?output=true\')">click me and read ' . $_SESSION['dummy'] . '</a>';
}
?>
</body></html>
This is a simple test to see if sessions work properly on your machine. When calling the file via HTTP you should see the output "click me and read XXXXX" whereas XXXX is an integer. When you click the link a new window should open and give you the same integer number.

If it doesn't, then either your PHP sessions don't work properly, or the cookie support is deactivated, or your browser does have problems with cookies.

If it works, then there's a bug within Serendipity and I'll try to catch it; but I may need a simple user account access to your blog then...

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
leonardb
Regular
Posts: 53
Joined: Fri Jan 14, 2005 10:27 pm

Post by leonardb »

ok ..

test.php opens..

click me and read 1105803454


when i click it, i get

DUMMY IS: 1105803507


so the problem, is on my end, just great!

any suggestions? im not too knowledgeable about sessions..
leonardb
Regular
Posts: 53
Joined: Fri Jan 14, 2005 10:27 pm

Post by leonardb »

could it possibly be

The domain for which the cookie is valid.
session.cookie_domain =

its blank .. but i do host multiple domains?
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Argh, I'm sorry, the test.php code was wrong. Please try again with this:

Code: Select all

<?php
session_start();
?>
<html><body>
<?php
if ($_GET['output'] == 'true') {
    echo 'DUMMY IS: ' . $_SESSION['dummy'];
} else {
    $_SESSION['dummy'] = time();
    echo '<a href="#" onclick="window.open(\'test.php?output=true\')">click me and read ' . $_SESSION['dummy'] . '</a>';
}
?>
</body></html>
(session.cookie_domain is right for you!)
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
leonardb
Regular
Posts: 53
Joined: Fri Jan 14, 2005 10:27 pm

Post by leonardb »

garvinhicking wrote:Argh, I'm sorry, the test.php code was wrong. Please try again with this:

Code: Select all

<?php
session_start();
?>
<html><body>
<?php
if ($_GET['output'] == 'true') {
    echo 'DUMMY IS: ' . $_SESSION['dummy'];
} else {
    $_SESSION['dummy'] = time();
    echo '<a href="#" onclick="window.open(\'test.php?output=true\')">click me and read ' . $_SESSION['dummy'] . '</a>';
}
?>
</body></html>
(session.cookie_domain is right for you!)
Now it looks right

click me and read 1105804431

DUMMY IS: 1105804431

So cookies and sessions is working correctly..
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hm, now I'm a bit out of clues.

Could you create me a simple Userlevel 0 account on your blog, so I could try it on your machine, please? If yes, please mail me privately at "serendipity (at) supergarv [dot} de"
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
leonardb
Regular
Posts: 53
Joined: Fri Jan 14, 2005 10:27 pm

Post by leonardb »

garvinhicking wrote:Hm, now I'm a bit out of clues.

Could you create me a simple Userlevel 0 account on your blog, so I could try it on your machine, please? If yes, please mail me privately at "serendipity (at) supergarv [dot} de"
done, you've got mail :)
leonardb
Regular
Posts: 53
Joined: Fri Jan 14, 2005 10:27 pm

Post by leonardb »

i think maybe it was because i did have sessions set to a single domain. then after clearing it and leaving it blank. i had to log out and relog back in but clear cookies before.. now it all works .. garvin you rock ..
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Phew, great we figured that out finally :-D

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Post Reply