How Sessions work in PHP

Discussion in 'PHP' started by manemdeepthi, Jul 7, 2008.

  1. #1
    How Sessions are created is it between web server and browser or something else and from where it will take session time period

    Thanks in Advacne
     
    manemdeepthi, Jul 7, 2008 IP
  2. Danltn

    Danltn Well-Known Member

    Messages:
    679
    Likes Received:
    36
    Best Answers:
    0
    Trophy Points:
    120
    #2
    Sessions are created by the server (session_start();) and stored on the server, the user simply has a session ID which allows the server to know where to look to call up the temporary file that's holding the data.

    Dan
     
    Danltn, Jul 7, 2008 IP
  3. nile1483

    nile1483 Active Member

    Messages:
    345
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    60
    #3
    Shortly session is a Memory machine, You can Store Some value in session and you can use it when you want it(Before they expire), It is procedure in your server (session data stored in server) so visitor (From client browser )cannot hack what value stored in session.


     
    nile1483, Jul 7, 2008 IP
  4. manemdeepthi

    manemdeepthi Peon

    Messages:
    12
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Thank You for the reply

    sessions after sometime expire and again it will ask for login, so how the time period is consider is it consider at what time a user login or it takes server time
     
    manemdeepthi, Jul 8, 2008 IP
  5. singh.ajit05

    singh.ajit05 Peon

    Messages:
    83
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Why not use cookies, you can set time for 1 hours, 1 days , 1 weeks or as your wish
     
    singh.ajit05, Jul 8, 2008 IP
  6. ayaw

    ayaw Peon

    Messages:
    164
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Session is Global Variable that stored in Server.
    for example, session is used to "Log In"
     
    ayaw, Jul 8, 2008 IP