News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

session always expires

Started by george from ohio, July 26, 2005, 02:17:39 PM

Previous topic - Next topic

george from ohio

what do i do? the session keeps expiring?!?
i'm either constantly asked to go back and try posting, changing, etc. (submitting a form) over again, or the forum tells me to log back out and log in. It works occassionally.
What could be causing this?
I've tried dbase, and local cookies -that doesn't help at all
also frequently get session could not be validated error?

what could be causing this? please help!
thanks!

george from ohio

#1
Please developers! Help!!! It's driving me crazy!
Why does the session expire ever so often, when i'm posting my messages etc. I have to click post twice.
Skin uses everything from the default folder, so why could this be happening please help.

george from ohio

In other news, this only happens this badly when using
INTERNET EXPLORER!!! GRRR!!
Why! Oh! Why!!!

[Unknown]

Patience.

Please post a link - I'd like to see if it happens for me, using Internet Explorer.  Have you tried clearing your cookies?

-[Unknown]

george from ohio

I tried clearing cookiees, i tried everything but it doesn't seem to work.
Looks like many ppl have this problem? Hasn't it been resolved yet? It's only an I.E problem, i tried it from 3 different locations. Only I.E give this problem? Why could that be? Are there any scripts that cause this? seems fine on other smf forums.

devilkin

SMF 1.1.1, located at http://www.aelst.be/smf/

george from ohio


so sorry just found out i can't make the link or domian public till august 15th.

[Unknown]

Quote from: jason_kraft on July 27, 2005, 02:09:22 PM
I tried clearing cookiees, i tried everything but it doesn't seem to work.
Looks like many ppl have this problem? Hasn't it been resolved yet? It's only an I.E problem, i tried it from 3 different locations. Only I.E give this problem? Why could that be? Are there any scripts that cause this? seems fine on other smf forums.

Most people who have this problem have something configured incorrectly.  Of course it works on other forums - you thought SMF didn't work with IE ::)?

Are you using database-driven sessions, or not?  Whichever you are, try using the other setting.  You can change it with repair_settings.php.  What is repair_settings.php?

-[Unknown]

george from ohio


Quote
Most people who have this problem have something configured incorrectly.  Of course it works on other forums - you thought SMF didn't work with IE ::)?

:D! i'm sorry -it's more about the fustration... "why me??" kind of thing.

I first tried database driven sessions.
when that didn't work, i tried local cookies... but that didn't work either.
Things i noticed
* You know, it gives me less than a second before asking for the password to administrator.
* When i post, the session expires almost immediately, however when i press post again it works.
* Occassionaly, the session can not be verified and thats it! Period.

I really appreciate the help.

[Unknown]

Very strange.  Do you know if you're on a load balanced network of servers or something like that?  Meaning, like SourceForge or something?

Let's try something drastic.  Open Sources/Load.php, and find:

function sessionDestroy($session_id)
{
global $db_prefix;

if (preg_match('~^[A-Za-z0-9]{16,32}$~', $session_id) == 0)
return false;

// Just delete the row...
return db_query("
DELETE FROM {$db_prefix}sessions
WHERE session_id = '" . addslashes($session_id) . "'
LIMIT 1", __FILE__, __LINE__);
}

function sessionGC($max_lifetime)
{
global $db_prefix, $modSettings;

// Just set to the default or lower?  Ignore it for a higher value. (hopefully)
if ($max_lifetime <= 1440 && !empty($modSettings['databaseSession_lifetime']))
$max_lifetime = max($modSettings['databaseSession_lifetime'], 60);

// Clean up ;).
return db_query("
DELETE FROM {$db_prefix}sessions
WHERE last_update < " . (time() - $max_lifetime), __FILE__, __LINE__);
}


Replace:

function sessionDestroy($session_id)
{
return true;
}

function sessionGC($max_lifetime)
{
}


This way, it will never delete anything (hopefully.)  Make sure database driven sessions are being used.

How do I modify files?

-[Unknown]

george from ohio

#10
Ok, I did that.
I replaced the sessionDestroy and sessionGC
1. I chose to use database driven sessions
1.1 with local cookies disabled
Results:
- browsers like (mozilla, opera, netscape) start complaining, some just don't do anything when i click logout etc.
- IE is worse now, doesn't even let me see the admin, or logout or post topics

1.2 with local cookies enabled
Results:
- browsers like (mozilla, opera, netscape) are working perfecto.
- IE still worse that it was before, duhn't even let me see admin, logout, or modify unless i delete cookies under internet explorer

3. so i'm going to revert back to original load.php file?
results:
- IE still as bad

4. so reverted back to don't use database sessions *because i forgot to in step 3
results:
- IE still bad, doesn't even let me post anymore like it used to

5. tried swithing local cookies on and off
results:
- other browsers work fine in both cases
- IE hasn't returned to its first normal...


[Unknown]

Are you using frames or something?

-[Unknown]

george from ohio

No no frames used. pure css

[Unknown]

Strange.  That's really the main case where IE might not work but everything else would.

I'm afraid I may not be able to help you until it is accessable to me.

-[Unknown]

george from ohio

[unknown]...
Hi! I left a IM with the log in details? did you receive that?

george from ohio


[Unknown]
I've noticed something else, this happens in Opera 8.0 too. Is it something to do with the network here. Because it seems to be working fine at home.
I have send you a link and username.
I guess I will proceed to develop a template to match the main site now. Any ideas could help a lot. Thanks!

[Unknown]

Your session cookies are definitely being set incorrectly.

Is session.cookie_lifetime set to something other than 0?  I suggest the following settings:

session.auto_start   Off
session.cache_expire   180
session.cache_limiter   nocache
session.cookie_lifetime   0
session.cookie_path   /
session.cookie_secure   Off
session.gc_divisor   100
session.gc_maxlifetime   1440
session.gc_probability   1
session.use_cookies   On
session.use_only_cookies   Off
session.use_trans_sid   Off

If that doesn't help... you wouldn't happen to be willing to pm me with a phpinfo link, would you?

-[Unknown]

[Unknown]

Try adding this to Settings.php, before the ?>:

ini_set('session.cookie_lifetime', 0);

-[Unknown]

george from ohio

:o ..... :D

You are the best [Unknown]!!!

That seems to have solved the problem! (forever!... i hope)
When you find time, please explain to me why the cookie had to be registered twice locally.

I'll be putting in a word of special thanks to SMF and SMF Support in our site info area. You are awesome.

[Unknown]

Thanks.

The problem was that the session cookie was being set for longer than the session was actually lasting.

-[Unknown]

Advertisement: