Session issues with SMF 1.0 Public beta

Started by Forse, March 14, 2004, 09:26:15 AM

Previous topic - Next topic

Forse

Hello

I am new here, but I have followed SMF devel for some short time now and I am really waiting for it to go stable. Anyway I got mail today about public beta and I jumped right on it. I installed it and all went well but now I have issues with forum sessions related.

I installed it and logged in and ofcoz I went to admin panel to see all the GOOD stuff, but I got this:
QuoteYour session timed out while posting. Please go back and try again.
and this php error
QuoteNotice: A session had already been started - ignoring session_start() in /www/forum/index.php on line 89

Line 89 is
Quotesession_start();

Seems like a great software, but I can't even logout now as it says:
QuoteSession verification failed. Please try logging out and back in again, and then try again.
and same session error on like 89.

T:Forse

Chris Cromer

Sounds like your host has php.ini set to make it so sessions automatically start... either that or you are including SMF from a script that uses session_start.

Replace that session_start(); line with this and see if fixes it:

if (!ini_get('session.auto_start')) {
session_start();
}
Chris Cromer

"I was here, here I was, was I here, sure I was" - The little voice in my head.

Forse

Quote from: Chris Cromer on March 14, 2004, 09:35:50 AM
Sounds like your host has php.ini set to make it so sessions automatically start... either that or you are including SMF from a script that uses session_start.

Replace that session_start(); line with this and see if fixes it:

if (!ini_get('session.auto_start')) {
session_start();
}


Nope :( Anyway I am ower of my server so if there are some changes needed to be made tell me. Also I have turckcache if it helps...

Chris Cromer

I think turckcache uses sessions if I am not mistaken... try turning it off and see if that fixes it.
Chris Cromer

"I was here, here I was, was I here, sure I was" - The little voice in my head.

Forse

Quote from: Chris Cromer on March 14, 2004, 09:46:12 AM
I think turckcache uses sessions if I am not mistaken... try turning it off and see if that fixes it.

Hmm I can't do that :( I have very "heavy" PHP scripts and if I turn off turckcache it will increase loading times a LOT. Also I have vBulletin and InvisionBoard and phpBB installed and all work fine  :-\

Chris Cromer

Well that is very odd... are you loading SMF from within another script?
Chris Cromer

"I was here, here I was, was I here, sure I was" - The little voice in my head.

Forse

Quote from: Chris Cromer on March 14, 2004, 10:01:42 AM
Well that is very odd... are you loading SMF from within another script?

Hmm nope. You can see forum here: http://www.animeyume.org/forum/index.php [nofollow]

Chris Cromer

Could you post a phpinfo file so we could have a look?
Chris Cromer

"I was here, here I was, was I here, sure I was" - The little voice in my head.

Forse

Quote from: Chris Cromer on March 14, 2004, 10:20:28 AM
Could you post a phpinfo file so we could have a look?

Sure =) I have apache apache-2.0.48-r1 and mod_php mod_php-4.3.4-r4 and mysql-4.0.17 and here is phpinfo u asked: http://www.animeyume.org/phpinfo.php [nofollow]

I hope it helps  ::)

Chris Cromer

Alright after some playing around I have reproduced this bug by changing my php.ini configuration for "session.save_handler" to match yours.

Change session.save_handler in php to be "files" instead of "mm" and it should fix it. :)
Chris Cromer

"I was here, here I was, was I here, sure I was" - The little voice in my head.

Forse

Quote from: Chris Cromer on March 14, 2004, 11:40:57 AM
Alright after some playing around I have reproduced this bug by changing my php.ini configuration for "session.save_handler" to match yours.

Change session.save [nofollow]_handler in php to be "files" instead of "mm" and it should fix it. :)

I wonder why all other boards worked okey then....

P.S. Yes it fixed it

Chris Cromer

Not sure... chances are those boards either use their own session handler or they don't use php sessions at all. I will look into that...
Chris Cromer

"I was here, here I was, was I here, sure I was" - The little voice in my head.

Chris Cromer

I just checked, all 3 of those boards do not even use php sessions which is what explains it. SMF is the only one with php sessions.
Chris Cromer

"I was here, here I was, was I here, sure I was" - The little voice in my head.

Forse

Quote from: Chris Cromer on March 14, 2004, 12:03:16 PM
I just checked, all 3 of those boards do not even use php sessions which is what explains it. SMF is the only one with php sessions.

Is there some advantage to this? Some servers use session.save [nofollow]_handler = mm to gain a little performance boost upon large loads

Chris Cromer

The advantage is that people can login without needing cookies enabled on their browsers. Also it adds security for certain areas like logout.(which is why the session id is in the url for it)

I only checked if those boards use php sessions though... they might have their own systems to let users login with cookies disabled that they coded themselves.
Chris Cromer

"I was here, here I was, was I here, sure I was" - The little voice in my head.

Chris Cromer

Alright I did some experimenting and phpBB and Invisionboard work with cookies turned off, but they don't use php sessions, they use their own system that they made. vBulletin however does not work with cookies off.
Chris Cromer

"I was here, here I was, was I here, sure I was" - The little voice in my head.

teeps

Quote from: Chris Cromer on March 14, 2004, 09:35:50 AM
Sounds like your host has php.ini set to make it so sessions automatically start... either that or you are including SMF from a script that uses session_start.

Replace that session_start(); line with this and see if fixes it:

if (!ini_get('session.auto_start')) {
session_start();
}

I'm on a server which I do not own, I made this change, but I'm still getting lots of Session time out errors.  Any ideas?

Cheers.

[Unknown]

It's possible that the sessions are not saving properly on your server.  Ask your host to make sure the session.save_path is correct and writable.

-[Unknown]

TasMan

You will also get them if your MySQL version is too old (probably due to that new session feature in 3.23.4). I thought SourceForge had 3.23, but it had been a long time since I bothered to look at it (phpinfo page that is). I got a lot of session timeouts while trying to do a few tests, and quickly found out I was using MySQL 3.22 =p. Since you don't own the server, you should run a phpinfo script to confirm you indeed do have the min requirements.

Then again, if it's only a lot, and not constant session timeouts, it's probably something else.

teeps

#19
PHP version 4.12, MySQL 3.23.58, phpinfo is here [nofollow].

It shows session.save [nofollow]_path set to /tmp, is that likely to be wrong or right?

Teeps

Advertisement: