:: Your Computer Technical Resource Headquarters! :: Your Computer Technical Resource Headquarters!
Computer Support Forums arrow Software Support arrow Programming Problems arrow Topic: ?Cookie Coding Problem?
December 09, 2019, 07:34:47 AM

Home Forum Rules Help Search Mobile Version Login Register

Welcome, Guest. Please login or register.
Did you miss your activation email?
December 09, 2019, 07:34:47 AM

Login with username, password and session length
 Featured Sites:
12th Anniversary Celebrating 12 Years! (1997 - 2009) 12th Anniversary
Thanks to ALL that make this site what it is!
  0 Members and 1 Guest are viewing this topic.
Pages: [1] Go Down Print
Author Topic: ?Cookie Coding Problem?  (Read 2283 times)

Karma: +0/-0
Offline Offline

Posts: 1

Bookmark and Share

View Profile
« on: February 07, 2007, 07:51:02 PM »


   I was wondering if anyone could help me figure out why my coding is not setting the cookie
as it should.  I've checked write permission issues, and that doesnt seem to be it. Its not even
trying to place the cookie and failing, just not writing it at all.  As this is for a shopping cart
program,  it is slightly essential to have the cookie set for anyone to add items to their cart.

Below is the code portions that deal with session creation and cookie set/get.


//CCGetCookie @0-705AF8CB
function CCGetCookie($parameter_name)
    global $HTTP_COOKIE_VARS;
    return isset($HTTP_COOKIE_VARS[$parameter_name]) ? $HTTP_COOKIE_VARS[$parameter_name] : "";
//End CCGetCookie

//CCSetCookie @0-1E0B074A
function CCSetCookie($parameter_name, $param_value)
  setcookie ($parameter_name, $param_value, time() + 3600 * 24 * 366); 
//End CCSetCookie

//CCGetSession @0-9BBC6D71
function CCGetSession($parameter_name)
    global $HTTP_SESSION_VARS;
    return isset($HTTP_SESSION_VARS[$parameter_name]) ? $HTTP_SESSION_VARS[$parameter_name] : "";
//End CCGetSession

//CCSetSession @0-0F088E96
function CCSetSession($param_name, $param_value)
    global $HTTP_SESSION_VARS;
    global ${$param_name};
    ${$param_name} = $param_value;
    $HTTP_SESSION_VARS[$param_name] = $param_value;
//End CCSetSession

Thanks for your help with this,
TimmyC Huh?
Supreme Loonie
Global Moderator
Hero Member

Karma: +16/-0
Offline Offline

Gender: Male
Posts: 1276

Bookmark and Share

View Profile
« Reply #1 on: April 20, 2007, 08:18:10 PM »

Off the top of my head, it seems like you're using two names for the same variable, i.e. $parameter_name and $param_name

Not that I'm much of a cookie programming expert, but to me this looks like one of the proof reading oversights that happen occasionally.

Pages: [1] Go Up Print 
Jump to:  

Powered by MySQL Powered by PHP

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines

Valid XHTML 1.0! Valid CSS!

This site is NOT responsible for any damage that the information on this site may cause to your system. Everything you try, whether inspired by the response given from this site or not, is entirely at your own risk. All product names and company names used herein are for identification purpose only and may be trademarks or registered trademarks of their respective owners. We are in no way affiliated or representing any of the companies on this site unless specified.
Back to Top
Stop Spam Harvesters, Join Project Honey Pot Fight Back Against Spammers! Get Firefox! Get Thunderbird! View Sylvain Amyots profile on LinkedIn
Back to Top
Google visited last this page June 11, 2018, 10:24:37 AM