SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Addict ketting00's Avatar
    Join Date
    Jul 2011
    Posts
    325
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    Session expires very quickly

    Hello everybody,

    I have session_start(); on every page of my script and I don't use cookie.

    But the browsers recognize my session only a short period of time. If I go away and come back, my session loses.

    Moreover, even I stay at the page of around two hours the session still expires.

    Can can I solve this issue.

    Thanks,
    Ket

  2. #2
    SitePoint Mentor bronze trophy
    John_Betong's Avatar
    Join Date
    Aug 2005
    Location
    City of Angels
    Posts
    1,882
    Mentioned
    74 Post(s)
    Tagged
    6 Thread(s)
    Quote Originally Posted by ketting00 View Post
    Hello everybody,

    I have session_start(); on every page of my script and I don't use cookie.

    But the browsers recognize my session only a short period of time. If I go away and come back, my session loses.

    Moreover, even I stay at the page of around two hours the session still expires.

    Can can I solve this issue.

    Thanks,
    Ket
    Extending session_start() is no mean task

    Study the following "User Contributed Notes" from te PHP Manual.

    "http://php.net/manual/en/function.session-cache-expire.php"

    I think it may be time to investigate Cookies();
    Learn how to be ready for The New Move to Discourse

    How to make Make Money Now with a *NEW* look

    Be sure to congratulate Wolfshade on earning Member of the Month for August 2014

  3. #3
    SitePoint Addict ketting00's Avatar
    Join Date
    Jul 2011
    Posts
    325
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Thank you

  4. #4
    From space with love silver trophy
    SpacePhoenix's Avatar
    Join Date
    May 2007
    Location
    Poole, UK
    Posts
    5,067
    Mentioned
    103 Post(s)
    Tagged
    0 Thread(s)
    In your php.ini file what settings have you got for:
    • session.gc_probability
    • session.gc_divisor
    • session.gc_maxlifetime
    Community Team Advisor
    Forum Guidelines: Posting FAQ Signatures FAQ Self Promotion FAQ
    Help the Mods: What's Fluff? Report Fluff/Spam to a Moderator

  5. #5
    SitePoint Wizard silver trophybronze trophy Cups's Avatar
    Join Date
    Oct 2006
    Location
    France, deep rural.
    Posts
    6,869
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by ketting00
    If I go away and come back, my session loses.
    By this, do you by any chance mean you leave a tabbed window open, you open/close a tab or close/open your browser, or do you even mean hang up you line then reconnect?

    Do you have several tabs open even?

    Can you be more explicit?

  6. #6
    SitePoint Addict ketting00's Avatar
    Join Date
    Jul 2011
    Posts
    325
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Cups View Post
    By this, do you by any chance mean you leave a tabbed window open, you open/close a tab or close/open your browser, or do you even mean hang up you line then reconnect?

    Do you have several tabs open even?

    Can you be more explicit?
    I navigate to the other site of around 1 hour using the same browser tab and come back to my website. I have to log in again because the session is expired.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •