session vs cookies..

Sunday 28 October 2012

Assalamualaikum wbrt my friends..


      For this coming entry I would like to share with you what is differences between session and cookies.. Actually, I’m just read about it.. Hee~..

     The main difference between cookies and sessions is that cookies are stored in the user browser and sessions are not.

      Session work like a token allowing access and passing information while the user open their browser.. While you close your browser you also lose your session.. This is because HTTP protocol is stateless, once the server replies to a request the server close the connection with the client and forgot all about the request..

Session Illustration 


       A cookie can keep information in the user browser until deleted.. It can be stored permanently or temporary, it is depends on user.. If a person has a username and password, this can be set as a cookie in their browser.. So next time they do not have to re-login back..


Cookie Illustration

     

0 comments:

Post a Comment