11Tami Posted September 6, 2007 Share Posted September 6, 2007 Whats the difference between a session and a cookie? Please let me know, thanks very much. Quote Link to comment Share on other sites More sharing options...
jitesh Posted September 6, 2007 Share Posted September 6, 2007 Session and cookie both are temporary saved the data in temporary files. The main diff is session's temporary files are saved in server while cookie's temporary files are saved in client machine. session will lost data when browser closed. while in case of cookie you can use persistent cookie so save data londger ........ ........................ ....................... Quote Link to comment Share on other sites More sharing options...
Jessica Posted September 6, 2007 Share Posted September 6, 2007 Please use google, thanks. Quote Link to comment Share on other sites More sharing options...
trq Posted September 7, 2007 Share Posted September 7, 2007 Its a bit like comparing apples to oranges. They are two different things. Sessions rely on cookies by default. When you start a session a cookie is stored on the client machine holding there session id. Any other data you place in a session is then stored in a temporary file on the server. Sessions last the lifetime of a clients visit and are genarally used to identify and login users. Cookies are simply text files stored on the client machine. While they can also beused for identification, because they reside on the client they are not as secure as a session may be. Quote Link to comment Share on other sites More sharing options...
ToonMariner Posted September 7, 2007 Share Posted September 7, 2007 Sessions are 'cookies' but stored on the server. The values of sesion variables can only be changed by the server. 'Cookies' are client side cookies (a session normally stores a cookie as an ID of a session cookie otherwose the ID gets apssed in the url). These are files (or portion of files) stored on your onw machine with info in them that the site can use. both sessions and cookies cna be hijacked - but only cookies can have their vlues altered by the malicious litle bugger messin around.... In short both are a buffer if you like of info that you may need to use a lot... Quote Link to comment Share on other sites More sharing options...
11Tami Posted September 7, 2007 Author Share Posted September 7, 2007 Thanks, so most agree the session only lasts for one visit? How would it identify those logging in each time if it ends after each visit? Please let me know, thanks very much. Quote Link to comment Share on other sites More sharing options...
trq Posted September 7, 2007 Share Posted September 7, 2007 How would it identify those logging in each time if it ends after each visit? A session wouldn't, you would need to use a cookie in that case. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.