what's the differnce between cookies and sessions in php?
543804
They effectively work the same; both record information, such as user names, that can be shared between Web pages.\n\nThe primary difference is a cookie is stored on your computer, and a session is stored in the Web server's memory. A session is also capable of holding more info than a cookie, and a session has a bigger impact on Web server response than a cookie does.\n\nUPDATE:\n\nFor the purpose of tracking a user through a Web application, you'd probably find a session variable a better way of managing user visits.
511581
Cookies are a security question, one you can determine by going to Tools, Internet Options, and then check the settings. You should see a setting for cookies under General. The higher the security setting, the less information your computer will accept.
994683
Since you didn't specify:\nIn IE ... \nTools/Internet Options/Privacy/Advanced \nunder First Party cookies make sure that "Accept" is checked and "Allways allow session cookies" I block third party cookies, but that's a personal choice.\n\nIn Firefox ... \nTools/Options/Privacy/ Cookies Tab/ check "Allow sites to set cookies"
535487
It's just a link that you can click on to get to another web page. For instance: http://www.cookiecentral.com/content.phtml?area=4&id=10\n\nThat is a hyperlink. If you click on it, it will take you directly to that web page. This is a web page that talks about "cookies". So if you don't know what cookies are, go ahead and click on it and it will answer all questions about them.
522581
I suspect you mean 'seSSion'...\n\nA session is initiated when you connect to a web site. The server assigns a session ID to you/your computer.\n\nSession IDs are often used to allow the comings and goings of a validated user on a site. Other session variables can be set and read by code as well.\n\nFor example, lets say someone successfully logs on to your site (password validated) you can create a 'Validated' session variable and check that as the user tries to go to a page. In this way, even if someone has an URL for a page and tries to go there without getting validated, your code can redirect him back to a logon page (for example).\n\nIn the sources below I have included some of my favorite ASP reference sites and some on sessions.\n\nGood Luck
942971
short answer: very little. \n\nmost websites dont really rely on cookies anymore cos users dont like them. temporary files are just that - temporary. so no biggie.
237694
Cookies are not "running" on your computer. Cookies are just text files saved on your computer, that save information about you and are used by the websites you visit. \nFor example, when you visit yahoo answers, after you login, your browser will save a cookie (a small .txt file) in your cookies directory, with your login ID and some other information more. Next time you come to yahoo answers, the website will use the information on that cookie to remember your user ID.\n\nJust be aware that cookies are not dangerous software. They may unprotect some your privacy, saving some information from websites you visit, but they are not dangerous. Basically, cookies can be seen as the browser memory. You can always disable them in your borwser settings if you don't want this type of information to be saved.
405579
there is a different cookie folder for each and,every account on the computer..your's is probably setup as a guest account
103418
Cookies are stored in a separate folder under ‘Windows’. They do not have any direct relationship to your registry. Deleting them has no effect on web applications as long as you do not turn them off(there is a OS setting for this). Any web application you may use will re-generate what ever cookie is needed when you sign in to the site.
1106008
A cookie is a file that is placed on your computer by a web site so it can store information such as your password for the site, last time you visited, or if you have purchased something from that site.  \n\nI am guessing that you are getting an error saying the cookies are disabled.  You can enable them in Internet Explorer 6 by:\nClick on the Tools menu, and selecting Internet Options\nClick on the Privacy Tab\nLower the security settings to Medium by sliding the little bar down
947812
initializesession.php\n  session_start()\n  $_SESSION['testvar'] = "test";\n\n\nrestievesession.php\n  session_start()\n  echo $_SESSION['testvar']\n\n\nJUST TRY TO RUN 1ST FILE "initializesession.php" AND THEN "restievesession.php" YOU WILL GET THE OUTPUT,BUT IF U RUN THE 2ND FILE "restievesession.php" FIRST THEN U NEVER GET THE OUT,SO FIRST U INITIALIZE THE VARIABLE IN THE SESSION AND THEN U CAN RETRIEVE THAT VARIABLE ANY WHERE IN THE PROJECT BUT THE CONDITION WILL BE U MUST DEFINE  session_start() FUNCTION
1179285
No you cannot have events. Sessions are stored within  as cache. You cannot crab the last instance of the session in PHP.\n\nBut what you could do  is do a check wheter that session is registered or not.\nhttp://ca3.php.net/session\n\nYou could loop through the session array and check if each session is registered if not, then they are not online. And you can do your actions there. Remember you need a cron or windows scheduler to handle the crons.\n\nGood Luck..
53607
A cookie is a packet of information sent by a server to a World Wide Web browser and then sent back by the browser each time it accesses that server. Cookies are mostly used for authentication, tracking, and maintaining user-specific information (preferences, electronic shopping cart, etc.)\n\nIf you want to get rid of the cookies in your browswer, if you're using Internet Explorer, go to Tools>Options and click delete cookies.\n\nTo set advanced cookie options, go to Tools>Options and then click on the Privacy tab. Click "advanced" and set options for cookies. I recommend allow first party cookies and blocking third party cookies. If you want to, you can click "prompt" for first party cookies, if you want to specify whether or not to allow cookies from specific websites (if you do this, you will have to approve all the sites that have to set cookies in your computer).\n\nRemember, though, that some websites can't funcion if you don't accept their cookies!
278316
http://www.php.net/manual/en/features.cookies.php
386483
A cookie is a small piece of information stored by your browser to help identify who you are. If your cookie is not being accepted correctly, you will be logged out of your account as soon as you move to a different page. This is what is likely blocking your current ability to log in or stay logged in.
689990
Hi,\n\nFor simplicity, you could do this in one file, but technically for a better design you need to do it in multiple files.\n\n► PROGRAMMING LANGUAGE\nPick a programming Language of your choice, like ASP / PHP / JSP / RUBY / PERL\nI will pick PHP in this example!\n\n► CREATE A CONTROLLER\n// Lets create a session\nsession_start();\n\n// set the current action\n$_action = isset($_REQUEST['action']) ? $_REQUEST['action'] : 'Login';\n\nswitch($_action) {\n    case 'LoginSubmit':\nprocessSubmit($_POST);\n        break;\n    case 'Logout':\n    processLogout();\n    break;\n    default:\n        displayLoginForm();  \n        break;   \n}\n\nNow you have to understand basic Login Syntax... first you will need to get the corresponding action... like mywebsite.com/?action=Login\nNow if you did what I said on top... It will check where the action = Login, in my case it will goto default and access the function displayLoginForm();\n\n► FUNCTION displayLoginForm()\nFor simplicity what this will do is display the form for login, like(remember do this in html):\n$output = '<form action="login.php?action=LoginSubmit" method="post">';\n$output .= '<input name="username"  type="text" />';\n$output .= '<input name="password"  type="text" />';\n$output .= '<input name="submit"  type="submit"  type="text" />';\n$output .= '</form>';\nprint $output;\n\nWhat this does, it prints the form after you access that function and onc eyou press the button it will goto the LoginSubmit action in the controller as I mentioned above\n\n► FUNCTION processSubmit($_POST);\nif($_POST['username'] == 'm0' AND $_POST['password'] == '123') {\n$_SESSION['user'] = $_POST['username'];\n} else {\nprint "Access Denied";\n}\n\nWhat that does, it checks if the user is m0 with pass 123,\n\n► FUNCTION processLogout();\nThat will just log out the user so you can just do...\nunset($_SESSION['user']);\nheader('Location: /Login.php');\n\n\n► CONCLUSION\nOkay I just did the script for you within 10 min! \nSee how simple.. Remember you can expand the processSubmit to suit your own interest, like checking the database instead...\nSELECT username FROM users WHERE username=%s AND password=%s\nAnd just compare the username to the one given.\n\nAnd remember you need to create session to save the data throught the whole session of the visting.. So in ohter pages you could do this on the first line..\nif(isset($_SESSION['user'])) {\n... Your code of that page\n} else {\nprint "access denied.. login first";\n}\n\nSee how simple... Please remember I im just showing you the concept with some code. I usually do it in a object oriented fashion and everything is independent... You should be able to grab the concept and do something fancy!\n\nI hope I helped if you need more advice you can visit my forum at university so we can help.\nhttp://www.campusinteractive.com/forum/\n\nEnjoy! and phew!! That took some time heh NOTE: there might be syntax error :p
992557
A Cookie is very small text file placed on your hard drive by a Web Page server. It is essentially your identification card, and cannot be executed as code or deliver viruses. It is uniquely yours and can only be read by the server that gave it to you. \n\nHow a Cookie Helps You: ???\nIt saves you time.\n\nThe main purpose of cookies is to identify users and possibly prepare customized Web pages for them. When you enter a Web site using cookies, you may be asked to fill out a form providing such information as your name and interests. This information is packaged into a cookie and sent to your Web browser which stores it for later use. The next time you go to the same Web site, your browser will send the cookie to the Web server. The server can use this information to present you with custom Web pages. So, for example, instead of seeing just a generic welcome page you might see a welcome page with your name on it. \n\nCONCERNED ABOUT SECURITY?\n\nCookies do not act maliciously on computer systems. They are merely text files that can be deleted at any time - they are not plug ins nor are they programs. Cookies cannot be used to spread viruses and they cannot access your hard drive. This does not mean that cookies are not relevant to a user's privacy and anonymity on the Internet. Cookies cannot read your hard drive to find out information about you; however, any personal information that you give to a Web site, including credit card information, will most likely be stored in a cookie unless you have turned off the cookie feature in your browser. In only this way are cookies a threat to privacy. The cookie will only contain information that you freely provide to a Web site.\n\n\nThis Answer was edited 3 Times to provide the most complete and accurate answer