#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2000
    Posts
    1
    Rep Power
    0
    I want a session to reset after a certain time.

    I read that the php.ini file could be changed, but I don't think that's the good solution.

    With the function session_set_cookie_params u can set the lifetime parameter.

    I also tried to put the time the session started in the session variable and compare this with the current time.

    I wonder what is a good solution, and why??

    Thanks to ya all!!!
    anita
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2000
    Location
    Newark, DE, USA
    Posts
    39
    Rep Power
    14
    you have to set the php session times in the php.ini file (for php4). this is a major flaw in php4, as session lifetime should be controllable by the application developer, instead of solely the system administrator.
    if you want to control session lifetimes, you may have more success using php3 with the implememtation of sessioning in phplib.

    ------------------
    ~Chris
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2000
    Posts
    1
    Rep Power
    0


    Well, thats the problem, I'm not using php3 because u can't use session management.

    There has to be a way to do it without messing with the php.ini file. (I can't change it, because there are more people working with this)

    But thanks anyway.

    Have any other ideas??

    greezz anita
  6. #4
  7. Banned (not really)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 1999
    Location
    Brussels, Belgium
    Posts
    14,640
    Rep Power
    4476
    Maybe you can store a timestamp in your session. When you restore the session one page, evaluate this time. If it's more than X minutes old, send them off to some other page using header()...

    My $0.02;

    ---John Holmes...

    ------------------
    *************************************************************
    * The manual can probably answer 90% of your questions...
    *
    * PHP Manual. www.php.net/manual
    * MySQL Manual: www.mysql.com/documentation/mysql/bychapter
    *************************************************************
  8. #5
  9. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2000
    Posts
    1
    Rep Power
    0
    Like I have a session variable $SESSION["time"] where I store time() in. Each time a new page is visited I compare this variable with the current time() ??

    I use something like that right now, but I hoped there was a better way.

    greez anita
  10. #6
  11. Banned (not really)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 1999
    Location
    Brussels, Belgium
    Posts
    14,640
    Rep Power
    4476
    Duh...I should of read your question more carefully...

    I'm not helping here...I'll depart...

    ---JH
  12. #7
  13. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2000
    Posts
    1
    Rep Power
    0
    Thanks anyway

Similar Threads

  1. refreshing page on session
    By xlordt in forum PHP Development
    Replies: 3
    Last Post: August 26th, 2003, 03:28 PM
  2. reading existing session, problem
    By buttie in forum Perl Programming
    Replies: 7
    Last Post: August 11th, 2003, 10:26 AM
  3. session start issue!
    By djl in forum PHP Development
    Replies: 0
    Last Post: July 29th, 2003, 01:37 PM
  4. PATH_INFO URL - Search Engine Friendly
    By Coopercentral2 in forum PHP Development
    Replies: 2
    Last Post: April 19th, 2003, 10:44 PM
  5. anonFTP hack?
    By (jp) in forum FTP Help
    Replies: 3
    Last Post: March 10th, 2003, 01:58 PM

IMN logo majestic logo threadwatch logo seochat tools logo