DragonPrime - LoGD Resource Community
Welcome Guest
  • Good morning, Guest.
    Please log in, or register.
  • July 31, 2010, 03:49:28 AM
Home Forums News Links Downloads Login Register Advanced Search
* * *
DragonPrime Menu
Login
 
 
Resource Pages
IRC Channels
Search

Pages: [1] 2   Go Down
  Print  
Author Topic: Where's the problem ?  (Read 2107 times)
0 Members and 1 Guest are viewing this topic.
Excalibur
Member
Mod God
*****
Offline Offline

Posts: 573


I'm a newbie, plz forgive me!


View Profile WWW
« on: April 21, 2005, 12:22:24 PM »

Hi,
we're finally translating LoGD 1.0.2 into italian, and actually only admins and moderators have access to new version. Yesterday, testing new stuff on 0.97 and translating text of 1.0 I've found a curious bug (if I can call it a bug). I was logged off in 0.97 while I was translating texts of 1.0, and hitting the refresh button in 0.97 instance I've found myself logged in  Shocked
I've done few other tests and the fact is reciprocal: if I'm logged in 0.97 version and logged off in 1.0, hiting refresh I get into the game. I have the same login name and password in the two games.
 
I've asked then a moderator to do some more tests, and he's got the same results, but he has found himself logged into the other version with a different charname (an admin char Shocked) and this could be a problem.

I suppose this is related to cookies, so I ask you if you've got similar experience and if you've found a solution.

Thanks in advance
Excalibur

FYI: 0.9.7 and 1.0.2 versions are installed into 2 different folder like www.myserver.com/logd97 and www.myserver.com/logd10
Logged

Spock: Random chance seems to have operated in our favor.
McCoy: In plain, non-Vulcan English, we've been lucky.
Spock: I believe I said that, Doctor.
Freeze
Guest
« Reply #1 on: April 21, 2005, 01:46:17 PM »

I've had this problem. When I was hosted with Murph' Server [Same one as Sichae] I had the problem of not being able to log into my game i was logged out of Sichae's site. Then when i tried to log in to the other, i was logged into one of Sichae's Staff [Selekta]. I brung this to Selekta's attention, but I dont know if it was ever fixed, of f anything was done about it.
Logged
Sichae
iMod God
SVN Users
Mod God
*
Offline Offline

Posts: 3458


If ya didn't get it by now... you're hopeless...


View Profile WWW
« Reply #2 on: April 21, 2005, 01:49:16 PM »

Sessions are stored in Cookies. Basically, the main server core is giving out the cookies, with a similar encoding. Since they were both LotGDs, and Xander had the acctid 2, as did Selekta on the main site, changing from site to site, on the same server, would account for this.

That is pretty much why.

It is happening now, since Steve decided to put another game on the server, and he is finding himself crossing over into my account.
« Last Edit: April 21, 2005, 01:51:37 PM by Sichae » Logged

If you didn't understand anything in the above post, don't try to attempt anything suggested.

Excalibur
Member
Mod God
*****
Offline Offline

Posts: 573


I'm a newbie, plz forgive me!


View Profile WWW
« Reply #3 on: April 21, 2005, 02:16:31 PM »

I've verified and you're right Sichae. I have the same acctid on both game, and the 1.0 mod has logged into admin's account on 0.97 'cause of the same acctid.

The obvious solution is to change cookie stored in one of 2 version, so the won't collide each other ... or have you found another solution ?
Logged

Spock: Random chance seems to have operated in our favor.
McCoy: In plain, non-Vulcan English, we've been lucky.
Spock: I believe I said that, Doctor.
Sichae
iMod God
SVN Users
Mod God
*
Offline Offline

Posts: 3458


If ya didn't get it by now... you're hopeless...


View Profile WWW
« Reply #4 on: April 21, 2005, 02:17:37 PM »

The obvious solution is to change cookie stored in one of 2 version, so the won't collide each other ... or have you found another solution ?

No solution found yet. Basically, if I am booted from my account, I call up Selekta, and tell him to get off. Smiley

Honestly though, it doesn't occur much often... only if both acctid's sessions are open. Then, some crossingover will occur.
« Last Edit: April 21, 2005, 02:18:57 PM by Sichae » Logged

If you didn't understand anything in the above post, don't try to attempt anything suggested.

Excalibur
Member
Mod God
*****
Offline Offline

Posts: 573


I'm a newbie, plz forgive me!


View Profile WWW
« Reply #5 on: April 21, 2005, 02:31:30 PM »

Honestly though, it doesn't occur much often... only if both acctid's sessions are open. Then, some crossingover will occur.
It could be used to hack one of the server if, for example, one admin's account has a high acctid ... e.g. one normal player on one game find this trick, and accidentally has the same acctid of an admin on other game, he could login and do a disaster  Undecided
Logged

Spock: Random chance seems to have operated in our favor.
McCoy: In plain, non-Vulcan English, we've been lucky.
Spock: I believe I said that, Doctor.
Sichae
iMod God
SVN Users
Mod God
*
Offline Offline

Posts: 3458


If ya didn't get it by now... you're hopeless...


View Profile WWW
« Reply #6 on: April 21, 2005, 02:39:30 PM »

*But* it should/will only occur, if the games are on the *same* server, that have a *similar/same* encoding for cookies. That is why I have no worries, since I control who is on the server or not.
Logged

If you didn't understand anything in the above post, don't try to attempt anything suggested.

Excalibur
Member
Mod God
*****
Offline Offline

Posts: 573


I'm a newbie, plz forgive me!


View Profile WWW
« Reply #7 on: April 21, 2005, 02:49:07 PM »

*But* it should/will only occur, if the games are on the *same* server, that have a *similar/same* encoding for cookies.
Our games are/will be on the same server.
Quote
That is why I have no worries, since I control who is on the server or not.
To do that I need to check the corrispondance between acctid on two games, and I have to remember that, maybe the next year when I'll do a reset, or if I promote player to mod/admin status (and I'm sure I'll forget it)
IMHO it would be better to change radically the way cookies are stored in one of logd version ... I'll investigate about cookies creation.
Logged

Spock: Random chance seems to have operated in our favor.
McCoy: In plain, non-Vulcan English, we've been lucky.
Spock: I believe I said that, Doctor.
Sichae
iMod God
SVN Users
Mod God
*
Offline Offline

Posts: 3458


If ya didn't get it by now... you're hopeless...


View Profile WWW
« Reply #8 on: April 21, 2005, 02:52:32 PM »

IMHO it would be better to change radically the way cookies are stored in one of logd version ... I'll investigate about cookies creation.

Yes, that is the best way to go about it.
Logged

If you didn't understand anything in the above post, don't try to attempt anything suggested.

Iwpg
Guest
« Reply #9 on: April 21, 2005, 03:04:24 PM »

Try setting PHP's "session.cookie_path" variable for each of the installations (using a PHP_Value directive in the .htaccess file, if using Apache, or an ini_set call in the lib/local_config.php).  So, for the 1.0.2 server, use either  
Code:
PHP_Value session.cookie_path /logd10/
or
Code:
ini_set('session.cookie_path', '/logd10/');
and for the 0.9.7 server use
Code:
PHP_Value session.cookie_path /logd97/
or
Code:
ini_set('session.cookie_path', '/logd97/');
Logged
Excalibur
Member
Mod God
*****
Offline Offline

Posts: 573


I'm a newbie, plz forgive me!


View Profile WWW
« Reply #10 on: April 22, 2005, 07:55:53 AM »

To Iwpg: I don't have local_config.php in lib folder, and I can't set the same variable in .htaccess with 2 different value (but I could be wrong about this).

I've search through common.php (0.97 version, but 1.0.2 are pretty much the same) and I've found the code that generate cookie:
Code:
$session[user][lastip]=$REMOTE_ADDR;
if (strlen($_COOKIE[lgi])<32){
    if (strlen($session[user][uniqueid])<32){
        $u=md5(microtime());
        setcookie("lgi",$u,strtotime("+365 days"));
        $_COOKIE['lgi']=$u;
        $session[user][uniqueid]=$u;
    }else{
        setcookie("lgi",$session[user][uniqueid],strtotime("+365 days"));
    }
}else{
    $session[user][uniqueid]=$_COOKIE[gsi];
}
and I've played a little with it to generate a different cookie (in 0.97). I've changed lsi[/color] to gsi[/color], I've also changed:
Code:
$u=md5(microtime());
to:
Code:
$u=md5(md5(microtime()));
but the 2 versions still interfere each other.
The two cookies are:
Code:
127.0.0.1   FALSE   /logd97/   FALSE   1145712888   gsi   801af9d12c8d3c6f4af30411e07d1db1
127.0.0.1   FALSE   /lotg10/   FALSE   1145712847   lgi   6b1a87b50a598b3eb824631c49790ddd
I suppose at this point that the problem is related to the fact that IP is the same, and now I'm stuck.

Any help (Kendaer are you here ? Grin) will be really appreciated  Smiley
Logged

Spock: Random chance seems to have operated in our favor.
McCoy: In plain, non-Vulcan English, we've been lucky.
Spock: I believe I said that, Doctor.
Talisman
Administrator
Mod God
*****
Offline Offline

Posts: 5207



View Profile WWW
« Reply #11 on: April 22, 2005, 08:15:51 AM »

This forum (YaBBSE) allows settable cookie names.  Maybe that's the way to go.
Logged

Play the latest beta version here on DragonPrime
Iwpg
Guest
« Reply #12 on: April 22, 2005, 12:14:09 PM »

To Iwpg: I don't have local_config.php in lib folder, and I can't set the same variable in .htaccess with 2 different value (but I could be wrong about this).
Is there no local_config.php even in 1.0.2?  Now you mention it, though, there could very well not be one in 0.9.7 (I don't have a copy to check), sorry for not thinking about that.  As for the .htaccess files, I meant having a seperate one for each game - /logd10/.htaccess would have the setting for the 1.0.2 game, and /logd97/.htaccess would have the setting for 0.9.7.  Again, sorry for not being clear. Undecided
Logged
Excalibur
Member
Mod God
*****
Offline Offline

Posts: 573


I'm a newbie, plz forgive me!


View Profile WWW
« Reply #13 on: April 22, 2005, 02:12:19 PM »

Nope Iwpg, no local_config.php even in 1.0.2
Don't worry, it's my fault as my knowledge of server configuration is not so good  Embarrassed
I thank everyone who has spent time trying to help me, I'll try your suggestion with .htaccess manipulation, and also Tal's suggestion.

I'll let you know when I'll find a working solution.
Logged

Spock: Random chance seems to have operated in our favor.
McCoy: In plain, non-Vulcan English, we've been lucky.
Spock: I believe I said that, Doctor.
Kendaer
Global Moderator
Mod God
*****
Offline Offline

Posts: 1806


Once a dragon, always a dragon


View Profile WWW
« Reply #14 on: April 24, 2005, 12:31:48 PM »

So, the problem is that it's not the lgi cookie which is causing your problem actually, but the session cookie which is automatically generated by PHP.

The function/variable you need to look at is session_name() (or session.name as the PHP ini variable).  this defines the name of the cookie which stores the session id for the php session.

In your lib/local_config.php (for version 1.0.2+) you will want to add the following
session_name("somestringhere");

Hope this helps.
Logged

Ex co-developer of LotGD
Pages: [1] 2   Go Up
  Print  
 
Jump to:  


*
DragonPrime Notices
Version 1.1.2 is the current supported version and is available for download.

Support Us
No funds raised yet this year
Your help is greatly appreciated!
Who's Online
26 Guests, 1 User
spector
DragonPrime LoGD
Recent Topics
Home Forums News Links Downloads Login Register Advanced Search