session expire help

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ljayz
    New Member
    • Feb 2007
    • 5

    #1

    session expire help

    i want my script to automatically expire session in a given period of time e.g 5mins (as a test). my problem is when ive set session_cache_e xpire(5); in my script, run it and wait for about 6-10mins then click a link that has the particular session it still dont expire. i have also tried ini_set(session .cache_expire, '5'); but still got no expired session. in php.ini session.cache_e xpire is set to 30. i have no access to php.ini. any idea guys on how to do this?
  • vssp
    Contributor
    • Jul 2006
    • 268

    #2
    session_cache_l imiter('private ');
    $cache_limiter = session_cache_l imiter();

    /* set the cache expire to 30 minutes */
    session_cache_e xpire (30);
    $cache_expire = session_cache_e xpire();

    /* start the session */

    session_start() ;
    // Unset all of the session variables.
    session_unset() ;
    // Finally, destroy the session.
    session_destroy ();

    Comment

    Working...