SitePoint Sponsor

User Tag List

Results 1 to 8 of 8

Thread: session help

  1. #1
    SitePoint Guru afridy's Avatar
    Join Date
    Mar 2007
    Posts
    966
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    session help

    Hai all,

    i have created 2 session varialbes for my entire payroll system.
    those are username and password.

    when user execute a query after he come back from an idle session, the page cannot be displayed occours. what is the solution to prevent this page cannot displays.

    Thank you for your wonder full support any time on the forum.

  2. #2
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,182
    Mentioned
    191 Post(s)
    Tagged
    2 Thread(s)

    sessions

    Do the pages they "come back from" have $_SESSIONs too?

  3. #3
    SitePoint Guru afridy's Avatar
    Join Date
    Mar 2007
    Posts
    966
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Mittineague View Post
    Do the pages they "come back from" have $_SESSIONs too?
    Yes mittineague,

    Assume, they view a report (pay sheet) and left it and went to the lunch.
    they come back after 45 minute or so and refresh it, they see a 'Page Cannot Display' page. then i check the home page that prints the login name as 'Welcome, xyz) but it was 'Welcome, ' . so i ask them to login again for the time beeng.

  4. #4
    SitePoint Addict
    Join Date
    Oct 2006
    Posts
    210
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You session file is being deleted. By default, PHP session files can be deleted after 24 minutes of idle time (assuming that your OS supports file modification timestamps). To fix this problem, you may find this article useful:

    http://www.captain.at/howto-php-sessions.php

    Hope this helps...
    mikem

  5. #5
    SitePoint Guru afridy's Avatar
    Join Date
    Mar 2007
    Posts
    966
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Thnks mikemchinney,
    i ll check your article and come back.
    thanks a lot

  6. #6
    SitePoint Guru afridy's Avatar
    Join Date
    Mar 2007
    Posts
    966
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Mikem..
    i use
    Code:
    session_start();
    
    $_SESSION['username']=$name;
    
    $_SESSION['password']=$pass;
    to create the session variables,
    i went through your article and it was talking about session cookies it seems.
    will that suggessions in the article can be applied to my situation?
    actually i like to encrease the time out period in the php.ini as sad in the article. but i did not fine this file under /tmp in the server after i loged in and created the above session variables.

    When a session is created, a flat-file is created on the server - e.g. in /tmp
    i did not see this file in the server after i log in.

  7. #7
    SitePoint Addict
    Join Date
    Oct 2006
    Posts
    210
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The article talks about session cookies because, by default, a cookie is used to send the session ID to the browser. The content of the $_SESSION array is never sent to the browser. The array is written to a file which, by default, resides in the /tmp directory. The filename is sess_sessionId.

    BTW, the php.ini file is not in the /tmp directory. On my Suse Linux machine, its in the /etc directory.

    Hope this helps...
    mikem

  8. #8
    SitePoint Guru afridy's Avatar
    Join Date
    Mar 2007
    Posts
    966
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Thanks Mike,
    I will check the file for existance.


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
  •