This is a discussion on Cookies within the PHP Programming forums, part of the Web Development category; Using Cookies:Before the advent of sessions, there were cookies. Cookies are files that get written to a temporary file ...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
| |||
| Using Cookies: Before the advent of sessions, there were cookies. Cookies are files that get written to a temporary file on a user’s computer by a web application. Cookies store information that can be read by the online application, thus authenticating a user as unique. By allowing a web application The problem with cookies is that because they are stored on a user’s computer, they have Cookies themselves are not bad or insecure if used correctly by a developer. However, |
| Sponsored Links |
| |||
| Setting Cookies: To be able to use cookies and store values in them, you must first set a cookie on a user’s bool setcookie ( string name [, string value [, int expire[, string path [, string domain [, bool secure]]]]])Code: PHP Code: Last edited by ragavraj : 10-30-2007 at 01:20 PM. |
| |||
| Reading Cookies: Naturally, there would be little use for cookies if you could not read from them, hence allowing PHP Code: |
| |||
| Deleting Cookies: Removing cookies is also a simple task. You should note that cookies will disappear by themselvesCODE PHP Code: |
| |||
| Getting Rid of "Magic Quotes" in Cookies Magic quoteswhich were covered and hated in the previous chapter, as wellalso apply to cookies because they are data coming from the client. So if magic_quotes is on, single and double quotes are escaped with backslash characters. To get rid of those, this code is used. A similar code was also used in the previous chapter to remove these escape characters from form data (GET and POST data). If magic_quotes is set, stripslashes() is applied recursively to all data in $_COOKIE. for example PHP Code: |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Cookies | nhoj | Java Server Pages (JSP) | 4 | 09-29-2008 12:32 AM |
| ASP.NET Cookies Overview | KiruthikaSambandam | ASP and ASP.NET Programming | 8 | 05-30-2008 02:10 AM |
| Cookies before start using in php | vigneshgets | PHP Programming | 1 | 01-18-2008 04:18 AM |
| Creating Cookies | pranky | HTML, CSS and Javascript Coding Techniques | 2 | 11-21-2007 05:02 AM |
| Cookies vs. Sessions | vijayanand | PHP Programming | 3 | 08-13-2007 08:36 AM |