Php sessions

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • deepaks85
    New Member
    • Aug 2006
    • 114

    Php sessions

    Dear Sir,

    I know that <? session_registe r();?> will register a variable that tracks the user ID during a session.

    And

    session_start() will start a session.

    But Should we always declare session_start() and session_registe r() together.

    What will happen if I declare session_start() and I don't declare session_registe r().

    The main thing is that........... .Can you please explain me the difference of both

    OR

    When can we use session_start() and session_registe r(). How they will work.

    Please help me sir.

    Thanks
    Deepak
  • ronverdonk
    Recognized Expert Specialist
    • Jul 2006
    • 4259

    #2
    session_start() creates a session or resumes the current one based on the current session id that's being passed via a request, such as GET, POST, or a cookie.

    session_registe r() accepts a variable number of arguments, any of which can be either a string holding the name of a variable or an array consisting of variable names or other arrays. For each name, session_registe r() registers the global variable with that name in the current session.

    All session related functions (and many examples on their use) are described in the standard PHP documentation. This at CXXXIX. Session Handling Functions

    Ronald :cool:

    Comment

    Working...