SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Thread: session ??

  1. #1
    SitePoint Evangelist priti's Avatar
    Join Date
    Aug 2006
    Location
    India
    Posts
    488
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    session ??

    Hello,

    I need to know how php handle session in the lowest level.all methods i know how to read write session etc.
    i mean i am searching for some fine grained knowledge how session are been recognised and work.

    i know the sessions are stores @ server in plain file,share memory or database then server set cookie in the http request and send to client where by client means our user agent will accept and set the cookie at local system and then it carries on but how php comes in the play ??

    i know session_start() will start the session and$_SESSION it will hold the var which we needs even i have done the programming also but there is something which i am not clear with

    hope someone can exactly make out what i am searching for

    Thanks & Regards

  2. #2
    rajug.replace('Raju Gautam'); bronze trophy Raju Gautam's Avatar
    Join Date
    Oct 2006
    Location
    Kathmandu, Nepal
    Posts
    4,013
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Umm! What exactly you want to know. Most of the things i think you are known to. Doesn't the PHP Session Handling make you clear? I think you must be clear about session from even php manual too.
    Mistakes are proof that you are trying.....
    ------------------------------------------------------------------------
    PSD to HTML - SlicingArt.com | Personal Blog | ZCE - PHP 5

  3. #3
    SitePoint Evangelist priti's Avatar
    Join Date
    Aug 2006
    Location
    India
    Posts
    488
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    session discussion!!

    Quote Originally Posted by rajug View Post
    Umm! What exactly you want to know. Most of the things i think you are known to. Doesn't the PHP Session Handling make you clear? I think you must be clear about session from even php manual too.
    ->how PHP assign session_id ??/
    ->How session_start() recognize the need of session ???
    ->the cookie set by user agent is a different dir where as session is stored differently for php in folder /temp?how this is managed???

    in an interview i been asked like if you have to manage session and we are not using cookies or url to append session var then how you will manage? i said you can store session data in db @ server .but he said not that way and i was wondering i had always manage the session like this only i don't know any fourthway :-( so i thought to explore session completely :-)

    revert back if u know any

    Regards

  4. #4
    . shoooo... silver trophy logic_earth's Avatar
    Join Date
    Oct 2005
    Location
    CA
    Posts
    9,013
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    If you are not using a cookie to pass the session id or appending the session id on a get variable then you cannot have a session. Or in other words it is impossible to have a session without one or the other.

    If you cannot pass the session id then the session makes a new one for the same agent every time in turn; not saving anything and become nothing more then a resource hog.

    The question you received was a trick question. Should have answered "One cannot have a session without passing a session id in a cookie or appending it on a url."
    Logic without the fatal effects.
    All code snippets are licensed under WTFPL.



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
  •