PHP Default Session Timeout

spacepir

New Member
Messages
41
Reaction score
2
Points
0
Hey, me again, this time I'm wondering what x10's default PHP Session timeout is, and if there's any way to change it. I don't have access to php.ini, and seeing as I'm on free hosting, I don't think I'm going to have the flexibility I require, for now.

The reason I ask the question is: After leaving my game idle for a while, I get an SQL error when my status bar updates itself. It happens because the Session has timed out, and, well, there's no session_id to forward to the database query.

As always, replies appreciated. :)
 

Skizzerz

Contributors
Staff member
Contributors
Messages
2,929
Reaction score
118
Points
63
No, there is no way to change it. The session timeout is the default PHP value (which means PHP sessions expire when the user closes their browser). If you use PHP's session mechanism (which I personally do not recommend, as it has numerous downsides, such as the inability to load multiple pages at the same time), and desire sessions that last for how long YOU control, you need to back it with your own session mechanism.

EDIT: Additionally, always be sure to check for an active session before issuing any session-related db queries.
 
Last edited:

spacepir

New Member
Messages
41
Reaction score
2
Points
0
Ok, well it seems to be expiring every half hour or so, which seems close to PHP's default. (24 mins). Does anyone have any solutions? :confused:
 

ezadx10b

New Member
Messages
29
Reaction score
0
Points
1
use htaccess

#change default session name for security default is PHPSESSIONID
php_value session.name "©$-£??!?€-FgbJJ7HCga"
#session timeout
php_value session.cache_expire "30"
#for secure session only use if u have ssl
php_flag session.cookie_secure "Off"
 

freshfa2

New Member
Messages
2
Reaction score
0
Points
1
Help i cant figure out why it wont let me edit anything in file manager keeps saying this when i wanna put a link in my site

Your editing session has expired.
This is usually caused by a long period of inactivity. Please re-load the page.
 

Skizzerz

Contributors
Staff member
Contributors
Messages
2,929
Reaction score
118
Points
63
@ezadx10b: php_flag and php_value do not work on x10Hosting, there is no way for end users to modify the PHP configuration outside of what is allowed in ini_set().
@freshfa2: try adjusting your browser's cookie settings or trying with a different browser. If all else fails, use FTP. The File Manager is part of cPanel, so if there are bugs with it, it is impossible for us to fix them.
 

freshfa2

New Member
Messages
2
Reaction score
0
Points
1
Skizzerz Thanks for the response but Ive tried every browser and still nothing even used a different Computer at my local library and still nothing
 
Top