Results 1 to 3 of 3
  1. #1
    Join Date
    May 2008
    Posts
    17
    Plugin Contributions
    0

    Default application_top is unsetting non-zen session variables

    I'm setting a session variable on a non-zen cart page (ad tracking url), and then sending a 301 redirect to a zen cart product page. This is for tracking inbound clicks for an ad campaign.

    Tracking page code:
    PHP Code:
    session_start();
    $_SESSION['utm_source'] = $_GET['so'];
    Header"HTTP/1.1 301 Moved Permanently" );
    Header"Location: http://www.my-site.com/abcd-".$_GET['p'].".html");
    exit(); 
    Problem is, in the footer of the product page, $_SESSION['utm_source'] is suddenly empty! It seems something about zen cart is emptying/unsettling non-zen session variables?

    If my tracking page redirects to another non-zen page the session var shows up just fine. I can also call:

    PHP Code:
    session_start();
    echo 
    $_SESSION['utm_source']; 
    ...at the very begining of index.php (before require('includes/application_top.php');) and it shows up correctly.

    On the line after the application_top.php include, the variable is empty.

    Any ideas why this is?

  2. #2
    Join Date
    Jan 2004
    Posts
    66,363
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: application_top is unsetting non-zen session variables

    Moderator note: Moving out of bug reports area, since this is not a Zen Cart bug.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Jan 2004
    Posts
    66,363
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: application_top is unsetting non-zen session variables

    Zen Cart is not unsetting anything.

    Instead, Zen Cart is merely activating the Zen Cart-specific session, and not your generic session.
    I would suggest that you launch application_top from your other script so the variable is set within a Zen Cart session.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

 

 

Similar Threads

  1. Session variables assignments
    By race1 in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 12 Aug 2008, 05:18 AM
  2. Replies: 0
    Last Post: 5 Mar 2008, 01:22 PM
  3. Add Session Variables
    By santoshshaw in forum General Questions
    Replies: 1
    Last Post: 8 Nov 2007, 11:31 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR