|
[F] global.php: clearing all guest sessions on guest with banned ip [C-Michael83]
|
|
02-13-2009, 08:14 AM
Post: #1
|
|||
|
|||
|
[F] global.php: clearing all guest sessions on guest with banned ip [C-Michael83]
MyBB 1.4.4:
Guest sessions are disappearing after a while. I have something like "100 logged users, 3 hidden, 500 guest" and after a minute all guests are gone. In file global.php code: PHP Code: // Check banned ip addressesReplace with something like: PHP Code: if(is_banned_ip($session->ipaddress, true))www.kozik.net.pl - So... Maybe you shouldn't have hacked it. - And why don't you try not breathing. Hurts, dunnit. (userfriendly.org) |
|||
|
02-13-2009, 05:22 PM
Post: #2
|
|||
|
|||
|
RE: global.php: clearing all guest sessions on guest with banned ip
Ah, nice catch
|
|||
|
02-15-2009, 02:16 PM
(This post was last modified: 02-15-2009 02:18 PM by koziolek.)
Post: #3
|
|||
|
|||
|
RE: global.php: clearing all guest sessions on guest with banned ip
Fixing this bug exposes another problem or bug - clearing old sessions once a day is insufficient. My mybb_sessions table has 109000 records... It is big because of old sessions which should be deleted once or twice per hour (and a session is old after 15-30 minutes of inactivity).
Working with big mybb_sessions table is slow also because of: Code: DELETE So after fixing the problem described in first post (clearing all guest sessions): - add an INDEX to column ip in mybb_sessions table; - clear old sessions more often. www.kozik.net.pl - So... Maybe you shouldn't have hacked it. - And why don't you try not breathing. Hurts, dunnit. (userfriendly.org) |
|||
|
02-16-2009, 04:12 AM
Post: #4
|
|||
|
|||
|
RE: global.php: clearing all guest sessions on guest with banned ip
I don't see a problem adding an index to the IP, but you should never have that many sessions in that table (ncaabbs doesn't and we have on avg ~500 users online at any time) and it should be in memory if it's that big.
|
|||
|
02-16-2009, 08:13 AM
Post: #5
|
|||
|
|||
RE: global.php: clearing all guest sessions on guest with banned ip
(02-16-2009 04:12 AM)Ryan Gordon Wrote: you should never have that many sessions in that table (ncaabbs doesn't and we have on avg ~500 users online at any time) and it should be in memory if it's that big.But I have. Why? Because I have really many visits from Google (many new users = many new sessions). I have online from 700 (morning) to 2500 (evening) users (guest+registered) and about 1,2 million real users per month (audited data from polish stats company). This means that I have many new sessions. After fixing this bug it took only 1 day to grow mybb_sessions to 100000 records. I added a task (half-hour): PHP Code: function task_pcf_sessions_cleanup($task)www.kozik.net.pl - So... Maybe you shouldn't have hacked it. - And why don't you try not breathing. Hurts, dunnit. (userfriendly.org) |
|||
|
02-16-2009, 08:33 AM
Post: #6
|
|||
|
|||
|
RE: global.php: clearing all guest sessions on guest with banned ip
When does MyBB create a session in the database and how does it re-identify the users? If it's cookies then I guess anything that doesn't use cookies would create phantom sessions with every request?
Google SEO | Gravatar | Hooks | HTMLPurifier | Overview | Patches | PluginLibrary |
|||
|
02-16-2009, 08:39 AM
Post: #7
|
|||
|
|||
|
RE: global.php: clearing all guest sessions on guest with banned ip
Clearing guest sessions more often sounds feasible - clearing all sessions (ie including users) would affect the Online Today function (heh, Who's Online Today on Index page plugins are going to take a hit though).
|
|||
|
02-16-2009, 08:48 AM
(This post was last modified: 02-16-2009 08:48 AM by koziolek.)
Post: #8
|
|||
|
|||
RE: global.php: clearing all guest sessions on guest with banned ip
(02-16-2009 08:33 AM)frostschutz Wrote: When does MyBB create a session in the database and how does it re-identify the users? If it's cookies then I guess anything that doesn't use cookies would create phantom sessions with every request?Yes, MyBB uses cookies. There are not many visitors with cookies disabled on my site (about 2-5%), but the phantom effect is possible. (02-16-2009 08:39 AM)Yumi Wrote: Clearing guest sessions more often sounds feasible - clearing all sessions (ie including users) would affect the Online Today function (heh, Who's Online Today on Index page plugins are going to take a hit though)."Online today" takes data from mybb_users.lastactive. I checked it on my board - it is functioning properly. www.kozik.net.pl - So... Maybe you shouldn't have hacked it. - And why don't you try not breathing. Hurts, dunnit. (userfriendly.org) |
|||
|
02-16-2009, 08:54 AM
Post: #9
|
|||
|
|||
|
RE: global.php: clearing all guest sessions on guest with banned ip
^ Hmm, you're right about that - my memory's failing me >_> Sorry.
|
|||
|
02-17-2009, 07:01 AM
Post: #10
|
|||
|
|||
RE: global.php: clearing all guest sessions on guest with banned ip
(02-15-2009 02:16 PM)koziolek Wrote: Fixing this bug exposes another problem or bug - clearing old sessions once a day is insufficient. My mybb_sessions table has 109000 records... It is big because of old sessions which should be deleted once or twice per hour (and a session is old after 15-30 minutes of inactivity). (02-16-2009 08:13 AM)koziolek Wrote:(02-16-2009 04:12 AM)Ryan Gordon Wrote: you should never have that many sessions in that table (ncaabbs doesn't and we have on avg ~500 users online at any time) and it should be in memory if it's that big.But I have. Why? Because I have really many visits from Google (many new users = many new sessions). I have online from 700 (morning) to 2500 (evening) users (guest+registered) and about 1,2 million real users per month (audited data from polish stats company). This means that I have many new sessions. After fixing this bug it took only 1 day to grow mybb_sessions to 100000 records. So can we accept this solution? (if so, the clearing task should be based on the setting) Creativity is a drug I cannot live without. |
|||
|
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)
Search
Member List
Calendar
Help



