Killersites.com Homepage Welcome Guest   |   Register  |  Login
Login Name Password
  Search  
  Index  | Recent Threads  | Unanswered Threads  | Who's Online  | User List  | Help


Quick Go »

No member browsing this thread
Thread Status: Active
Total posts in this thread: 3
[ Jump to Last Post ]
Post new Thread
Author
Previous Thread This topic has been viewed 27767 times and has 2 replies Next Thread
Male Zero
Advanced Member
Member's Avatar


Joined: Aug 23, 2005
Post Count: 101
Status: Offline
Reply to this Post  Reply with Quote 
confused session timeout (no php.ini access)

Dear All, biggrin

Im have setup a simple login script with sessions.
After about 3 min the session becomes invalid and i have to login again.

Is there any way i can increase the session time out without editing my php.ini (no access to php.ini) ????

Kind regards,

Zero

[Nov 30, 2006 7:50:55 AM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Male admin
Advanced Member
Member's Avatar


Joined: Jun 14, 2003
Post Count: 2940
Status: Offline
Reply to this Post  Reply with Quote 
Re: session timeout (no php.ini access)

To get the default (file-based-sessions) session timeout value on the server, you can view it through the ini_get command:

// Get the current Session Timeout Value
$currentTimeoutInSecs = ini_get(?session.gc_maxlifetime?);


Change the Session Timeout Value

// Change the session timeout value to 1 hr
ini_set(?session.gc_maxlifetime?, 60*60);

----------------------------------------
Stefan Mischook

Video Tutorial Store | Web Templates
[Nov 30, 2006 8:16:13 AM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Male Zero
Advanced Member
Member's Avatar


Joined: Aug 23, 2005
Post Count: 101
Status: Offline
Reply to this Post  Reply with Quote 
Re: session timeout (no php.ini access)

Dear Stefan,

Thanks for your quick response,
For some reason this code isnt working for me.

// Get the current Session Timeout Value
$currentTimeoutInSecs = ini_get("session.gc_maxlifetime");

When i echo $currentTimeoutInSecs i get the cureent session time. biggrin

But when i place
// Change the session timeout value to 1 hr
ini_set("session.gc_maxlifetime", 60*60);
before or after the session starts the $currentTimeoutInSecs dousnt change.

Kind regards,

Zero
[Dec 1, 2006 3:29:19 AM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
[ Jump to Last Post ]
Show Printable Version of Thread  Post new Thread