Cookie not cleared on logout Cookie not cleared on logout
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Cookie not cleared on logout

Started by Satyr, March 01, 2004, 11:29:22 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Satyr

I run Coppermine on a PhpBB. Now i have this prob.

The user "Anonymous" is recognized as "member".
So a not-logged-in user has the same right as members to post comments, upload and rate fotos etc. This is not so nice. How can i fix this?

Only registred users should be able to post comments and rate pictures.
Kein Support über PN. Bitte im Forum posten, dann ist anderen auch geholfen.

http://www.gothicmodels.net/gothicmodels/gallery/

Testuser: Test23 PW: 123456

Omen

go to your "Groups" setting and make sure all the priv's for Anonymous/Guests are set to NO

Satyr

Do you mean the last field to the right? I thought this is to set if the admin must approve the uploads or not...  :?:  

I'll try it, thx!  :wink:
Kein Support über PN. Bitte im Forum posten, dann ist anderen auch geholfen.

http://www.gothicmodels.net/gothicmodels/gallery/

Testuser: Test23 PW: 123456

Satyr

It does not work. If i logout i am still logged in, but as "Anonymous". And i can post comments. I have set that members can post comments, but not guests. But i am only a guest if i delete the cookies.

I have a problem more: I can not delete albums from users as admin!
Kein Support über PN. Bitte im Forum posten, dann ist anderen auch geholfen.

http://www.gothicmodels.net/gothicmodels/gallery/

Testuser: Test23 PW: 123456

Omen

ok...dispite the instructions of making your gallery cookie name and the phpbb cookie name match, i was still having problems myself... my setup is phpBB 2.0.6 and cpg 1.2.1

so, try this...

[edit, my bridge file and phpbb cookie name match but the gallery cookie in the config page is different]

Go to your config page in the gallery (if you can) and set the gallery cookie name something OTHER than your phpbb cookie name...

if you cannot access your gallery config, you must change the cookie name in SQL using something like phpMyAdmin...

if you do not have access to your database, you can use this code to change your cookie name...

just paste the following into a file, name it cpg_cookie.php and run it....

<?
// Change the following to fit your setup
$db_server    = "localhost"; // Change if neccessary
$db_user      = "root";      // Change if neccessary
$db_passwd    = "";          // Change if neccessary
$db_name      = "phpbb";     // Change if neccessary
$db_prefix    = "cmg_";      // This is the prefix for your GALLERY -NOT- PHPBB!!
$new_cookie   = "cpgcookie"; // This is the name of your new cookie

// Connecting to your database
$db = mysql_connect("$db_server", "$db_user", "$db_passwd");
mysql_select_db("$db_name",$db);

echo "Connecting to your database....";

// Getting current cookie name
$sql="SELECT name, value FROM {$db_prefix}config WHERE name = 'cookie_name'";
$result=mysql_query($sql,$db);
if(!$result)
{
echo "<b>Could not connect to your database.</b><br><br>" . mysql_error();
die;
}
$row = mysql_fetch_array($result);

echo "<b>Done</b><br><br>";
echo 'Your current cookie is <b>'.$row["value"].'</b><br><br>We will now set it to '.$new_cookie.'....';

// Change your cookie
$sql="UPDATE {$db_prefix}config SET value = '$new_cookie' WHERE name = 'cookie_name'";
$result=mysql_query($sql,$db);
if(!$result)
{
echo "<b>Could not connect to your database.</b><br><br>" . mysql_error();
die;
}
echo "<b>Done</b>";
?>

Satyr

In my coppermine config i have a different cookiename, it is something other than in phpbb. As i installed it i had changed the cookie name to the same cookiename as phpbb. The result was that i could not login anymore. So i changed it back to the original name which is different.

In my bridgefile i have the same cookie name as phpbb.
When i change this, login in coppermine does not work. :(
Kein Support über PN. Bitte im Forum posten, dann ist anderen auch geholfen.

http://www.gothicmodels.net/gothicmodels/gallery/

Testuser: Test23 PW: 123456

Omen

ok bro...

here are my exact settings...

Forum located at: mods.modpros.com/forum
Gallery located at: mods.modpros.com/gallery

Database name: phpbb
phpBB Prefix: phpbb_
Gallery Prefix: phpbbcm_

phpBB Cookie Domain: empty
phpBB Cookie Name: modprosmods
phpBB Cookie Path: /
Gallery Cookie Name: modpros_gallery
Gallery Cookie Path: /
phpbb.inc.php Cookie Name: modprosmods

After the cookie names are changed, clear your browsers old cookies...
With Internet Explorer click File>>Tools>>Internet Options - Delete Cookies
Note that it will wipe all your cookies....

Close your browser and try again....

If that still doesnt work, name ALL your cookies the same thing....
Do something easy like "mycookies1"

If thats STILL doesnt fix it, I dont know what else to suggest....
Just have to wait for an admin or mod to help ya...

Satyr

Thank you very much for you time. It's cool from you! :)

My settings are near the same than yours. Except that i have in the phpbb set the domainname.
When all cookies have the same name i can not login into gallery.
At the moment i have in the database two different cookienames and in the bridgescript the same as in phpbb. But when i give in the bridgescript another name like "cookie3" then login does not work. ^^
Kein Support über PN. Bitte im Forum posten, dann ist anderen auch geholfen.

http://www.gothicmodels.net/gothicmodels/gallery/

Testuser: Test23 PW: 123456

Omen

(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwww.mods.modpros.com%2Fgallery%2Falbums%2Fuserpics%2F10003%2Fgallery_privs.PNG&hash=0e328163f40024a0e1a5b04f8a99009b11b884c0)

Casper

On the cookie issue, they MUST have different names, NOT THE SAME.
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

Joachim Müller

and be carefull when choosing subject names: crying out "bug!" won't make you friends with the devs...
Generally speaking, you should use a subject line that actually describes your problem...

GauGau

Tolodine

I searched the board and found this topis as it is the same problem I am having at the moment. I have had to turn off comments for everyone except admins right now till I get it fixed. I am using the invisionboard bridge and not the phpbb bridge at the moment. I have both the board cookies and the gallery cookies set to different names. I have even tried setting them to the same names with no luck. I clear my cookies everytime I test new names and such with the same results. The only way it seems that the cookie gets completely cleared is:

1) I delete them all myself
2) I leave the gallery site and come back
3) I close out my browser and restart it

As I stated before, I have the guest commenting turned off. Only group I have set for commenting is admins right now. The script is simply not clearing the cookie completely until I actually leave the site. It will log me out as admin since I no longer get the links for the admin stuff such as editting and deleting and the config panel but it lets me comment as a guest till, like I said before, I clear the cookie completely myself. It is also logging me out of invision board just fine. It is like it is setting the guest commenting to "YES" when you log out.

I love the script and would like to use it on my site full time so any help would be appreciated.

[Edit: I found one problem but it still does fix the main problem. Why have album permissions for guest commenting as well as group permissions for guest commenting? The album permissions are overriding the group permissions until the cookie is completely cleared and then the group permissions take over. This explains why the guest commenting is getting set to "YES" when you log out. I didn't set it in the albums because I thought the group permissions would take over. Why isn't it checking the group permissions on logout? I think the setting needs to be either in the album properties OR in the group settings but not in both.]
Tolodine Tigerheart

Joachim Müller

The comment settings don't work the way you describe it: in the groups panel, you set which group is allowed to post comments at all. Let's say for an example, you allow comment posting for group A and B and deny for group C and D. In the album properties, you can override the settings you made in the groups panel, by setting "Visitors can post comments" to "no" for a specific album. This will deny comment posting for all groups (A, B, C and D). If you set it to "yes", it will only allow comment posting for the groups you set up in groups management (so A and B will be able to post comments, C and D won't).
Hope this makes the conecpt clear.

GauGau

Tolodine

I noticed that last night but was too tired to post again. heheh So this gets back to my original post. If a member logs in and then logs out they can post comments to anything as a guest until they leave the site or delete the cookie even though guest permissions for commenting is turned off. The cookie does not seem to be properly clearing. You would know better than I would what is going on but that is just what it looks like to me.

Here is problem number 2.

I turned my debug mode on and got the below debug data for User when I hit the logout button and view a picture.
USER DATA:

Array
(
    [0] => 0
    [user_id] => 0
    [1] =>
    [user_name] =>
    [2] => 4
    [mgroup] => 4
    [3] => 4
    [group_id] => 4
    [4] => Admin
    [group_name] => Admin
    [5] => 0
    [group_quota] => 0
    [6] => 0
    [has_admin_access] => 0
    [7] => 1
    [can_rate_pictures] => 1
    [8] => 0
    [can_send_ecards] => 0
    [9] => 1
    [can_post_comments] => 1
    [10] => 1
    [can_upload_pictures] => 1
    [11] => 1
    [can_create_albums] => 1
    [12] => 0
    [pub_upl_need_approval] => 0
    [13] => 0
    [priv_upl_need_approval] => 0
)

As you notice it is still giving me the permissions as admin and not guest. The name is blanked so it no longer recognizes me as actually logged in but it isn't resetting the group ID.

Hope this helps at all.
Tolodine Tigerheart

Satyr

I write this post as answer to this topic: http://forum.coppermine-gallery.net/viewtopic.php?p=18109

Sorry to gaugau for the topic title, was not very good. ;)

I have Coppermine integrated into a phpBB.
I have the following cookie-settings:

PhpBB under:
http://www.gothicmodels.net/gothicmodels/
Cookie-Domain: gothicmodels.net
Cookie-Path: /
PhpBB-Cookie: dimmysql

Gallery located under:
http://www.gothicmodels.net/gothicmodels/gallery

Gallery-Cookie: galcookie
Path of the cookie used by the script:  /
 
I have the problem that when i am not logged in, on the button is written: "Logout: Anonymous".
Cause i allowed members to comment and rate pictures, guests can post comments and also edit and delete the comments of other anonymous posters!  :shock:  

What is wrong anymore?  :?:    :oops:

[edit GauGau]
merged you posting with the thread you're refering to
[/edit]
Kein Support über PN. Bitte im Forum posten, dann ist anderen auch geholfen.

http://www.gothicmodels.net/gothicmodels/gallery/

Testuser: Test23 PW: 123456

Satyr

Thanks Gaugau! ;)

I have still not fixed my problem.
If change now something in the cookiesettings i can not login into my gallery.

My settings are described in the post above.
Kein Support über PN. Bitte im Forum posten, dann ist anderen auch geholfen.

http://www.gothicmodels.net/gothicmodels/gallery/

Testuser: Test23 PW: 123456