Jump to content

Sessions dying


jaymc

Recommended Posts

Ah ha, I think Im getting somewhere... Pulled this from an apache log

[client 62.31.66.249] PHP Warning:  Unknown: The session id contains illegal characters, valid characters are a-z, A-Z, 0-9 and '-,' in Unknown on line 0, referer: http://forum.jaydiocity.co.uk/index.php?act=Search&nav=lv&CODE=show&searchid=ddfc3ec2753d130b4bbda29fa80e0d6e&search_in=topics&result_type=topics&lastdate=
Link to comment
Share on other sites

More info

I checked the session id and the session id is actually the session valid

in the SESSION PATH their is my sessioin called sess_JAYMC

The rest, generated by the forum are all normal (sess_243234bgab234bdad)

Any ideas now?
Link to comment
Share on other sites

Ok, last bit of into

When i first login to my site and the session is created, it is created properly, in fact, here is the exact session name [b]sess_23leud1obhphvlhvof30g28mk5[/b]

Now, at no apparent time or on any certain page the session either gets removed or renamed to sess_VALUEOFSESSION

in my case, sess_JAYMC

When it does that, the browser still things its session id is [b]23leud1obhphvlhvof30g28mk5[/b] which obviously no longer exists

This, session dropped and logged out of the site..
Link to comment
Share on other sites

[quote author=jaymc link=topic=121834.msg503557#msg503557 date=1168640686]
But Ive been through all my scripts and the only thing they have regarding sessions is
session_start();
$User_Session = $_SESSION['username'];
[/quote]

do you mean to say that you never save any variables to the session? how does $_SESSION['username'] get populated? sessions aren't truly created until you either assign something to the $_SESSION super global, or use session_register().
Link to comment
Share on other sites

Also, you have session.gc_maxlifetime set to 1440 seconds, or 24 minutes. This is independent of the cookie lifetime and specifies how long your session lasts on the server before it's seen as garbage, to be taken out at each session_start with session.gc_probability/session.gc_divisor probability.
Link to comment
Share on other sites

[quote author=MCP link=topic=121834.msg504104#msg504104 date=1168721050]
[quote author=jaymc link=topic=121834.msg503557#msg503557 date=1168640686]
But Ive been through all my scripts and the only thing they have regarding sessions is
session_start();
$User_Session = $_SESSION['username'];
[/quote]

do you mean to say that you never save any variables to the session? how does $_SESSION['username'] get populated? sessions aren't truly created until you either assign something to the $_SESSION super global, or use session_register().
[/quote]

No... when I create the session in the login page I have

$_SESSION['username'] = $user

It is creating the session fine, I even viewed the sesion file and the correct data was in there

However, that session is being delete for some reason... here is an error from php log

[13-Jan-2007 18:06:05] PHP Warning:  Unknown: open(/SESSIONS/sess_a0vnknbget760coqib6sfrm8o7, O_RDWR) failed: No such file or directory (2) in Unknown on line 0

In other words, [b]sess_a0vnknbget760coqib6sfrm8o7[/b] did exist but for some reason was deleted

Also, I had echo session_id(); and after a while that was outputing the value of the session, not the ID

Confused
Link to comment
Share on other sites

By the way, if I set [b]session.gc_maxlifetime[/b] to 365 days then that will solve my problem as the session wont get terminated in the garbage clean out

However, the session file will remain on there for 365 days?

Will that cause problems? I'm not bothered if it will hog a gig of space, I just want this fixed

However, the defailt 24 mins, surely thats to clean out inactive sessions...? In other words sessions that have not been accessed within 24 minutes?
Link to comment
Share on other sites

You can leave sessions for as long as you want -- I don't think there's any technical restriction there.

Are you saying that the garbage collection is the mechanism clearing out your session? Are you reaching the 24 minute mark and having your session deleted?

Also, what do you mean by "session value"? What exactly does session_id() print?
Link to comment
Share on other sites

$_SESSION['username'] = 'JAYMC';

After a while and pretty random the ID comes out as $_SESSION['username'] which obviously is JAYMC

When that happens if I check my SESSION path their is a session created their called sess_JAYMC

I dont know whether its the garbage clearedout deleting to session.. its certainly not every 24 minutes dot on though, it can be after 8 minutes, or after 3 hours
Link to comment
Share on other sites

More errors...


[13-Jan-2007 18:06:15] PHP Warning:  Unknown: open(/SESSIONS/sess_alu5hnpp11fa3o6lf9oiujuum7, O_RDWR) failed: Permission denied (13) in Unknown on line 0
[13-Jan-2007 18:06:15] PHP Warning:  Unknown: open(/SESSIONS/sess_02kt5pb75qnltim8ec1ie14vi4, O_RDWR) failed: Permission denied (13) in Unknown on line 0
[13-Jan-2007 18:06:15] PHP Warning:  Unknown: open(/SESSIONS/sess_02kt5pb75qnltim8ec1ie14vi4, O_RDWR) failed: Permission denied (13) in Unknown on line 0

[13-Jan-2007 18:06:11] PHP Warning:  Unknown: open(/SESSIONS/sess_odhosb81j8mma3e5vo337o20s5, O_RDWR) failed: No such file or directory (2) in Unknown on line 0
[13-Jan-2007 18:06:11] PHP Warning:  Unknown: open(/SESSIONS/sess_a0vnknbget760coqib6sfrm8o7, O_RDWR) failed: No such file or directory (2) in Unknown on line 0
[13-Jan-2007 18:06:12] PHP Warning:  Unknown: open(/SESSIONS/sess_6v89cvm6aossdp4dj5kaeqf4p3, O_RDWR) failed: No such file or directory (2) in Unknown on line 0

[13-Jan-2007 18:06:08] PHP Warning:  Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/SESSIONS) in Unknown on line 0
Link to comment
Share on other sites

Strange on the sess_JAYMC. And you're not calling session_id with a parameter, right? Just for kicks, what happens if you assign another variable to your session? So something like $_SESSION['test'] = "test"; before the username assignment. Does the session id then become sess_test ?

Also, what are the permissions on /SESSIONS ? How much space on that partition?
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.