P3Pwriter Policy Editor
 
 
P3P Solutions
Develop your complete privacy policy using P3Pwriter. You can make changes for up to a year at no charge and we guarantee it will validate or you get your money back.
Start here -->

2.0 Cookie Methods
The following describes three methods of using cookies. The first is a client-side implementation and the last two are server-side cookies.

2.1 JavaScript Cookie Method
Create a cookie with the specified name and value.
function SetCookie(sName, sValue){
  document.cookie = sName + "=" + escape(sValue) + ";
  expires=Mon, 31 Dec 2010 23:59:59 UTC;";
}
 
Retrieve the value of the cookie with the specified name.
function GetCookie(sName){
  var docCookie = document.cookie
  if(docCookie.length>0){
    var begin = docCookie.indexOf(sName+'=')
    if(begin!=-1){
      end=docCookie.indexOf(';', begin)
      if(end==-1)end=docCookie.length
      return unescape(docCookie.substring(begin+sName.length+1, end))
    }
  }
  //a cookie with the requested name does not exist
  return null
}

2.2 PHP Cookie Method
int setcookie (string name [, string value [, int expire [, string path [, string domain [, int secure]]]]])
Setting a Cookie:setcookie ("TestCookie", $value,time()+3600); /* expire in 1 hour */
Getting a Cookie:$HTTP_COOKIE_VARS["TestCookie"];

2.3 ASP Cookie Method
Setting a Cookie:Response.Cookies("name") = value
 Response.Cookies("name").Expires = Date + 365
Getting a Cookie:value = Request.Cookies("name")

 Definitions
 Cookies
  1.0 Background
  1.1 Cookie Delivery
  1.2 Cookie Recipe
  1.3 Browser Interaction
  1.4 Cookie Flavors
  1.5 Cookie Owners
  2.0 Methods
  2.1 JavaScript Methods
  2.2 PHP Methods
  2.3 ASP Methods
  3.0 DoubleClick
  4.0 P3P Implications
  4.1 IE6 Cookie Actions
  4.2 Unsatisfactory Cookies
  5.0 P3P Cookie Element
  5.1 P3P Cookie Declaration
  5.2 Compact Policies
  6.0 Legacy Cookies
  6.1 Legacy Cookies Provisions
 EMail
 Web Logs
 P3P Purpose Elements
 Web Bugs
 Policy Planning
 Web Site Design
 P3P Technical Issues
 Compact Policy Validator
 Standard Policy Statements
 P3P Compact Policy
 P3P Headers
 Frames vs. Privacy
 P3P Policy Violation
 P3P Install with Mambo
 P3P Install with Lasso
 Blocked Cookies
 Yellow Input Elements
 2o7.net Tracking Cookies
 
    You are here:  Help > P3PSolutions > Cookies 
For site problems Contact us - For Privacy Issues see our Privacy Policy
© 2002-2010 P3Pwriter All Rights Reserved
P3PWriter
Home
Home
Home
MyAccount
MyAccount
MyAccount
FAQ
FAQ
FAQ
P3Psolutions
P3Psolutions
P3Psolutions