Results 1 to 7 of 7
  1. #1
    Join Date
    Jun 2008
    Posts
    61
    Plugin Contributions
    1

    Default Question about session id

    Hi,

    This is a general question about the id appended to the end of links when we access a Zen Cart site. For example, the Privacy link in the Information sidebox >>>

    anydomain.com/index.php?main_page=privacy&zenid=e5cd7ef5a6b6e3a569565915950fb745



    If I hard code the links in a sidebox, or add any hard coded links (in the sidebox template file.... the links won't have the id appended to the links anymore. (Sometimes I also hardcode the ezpages top menu links.. so that I can easily make the design to look anyway I want)

    Will there be any problems to the operation of the site??


    Thanks.

  2. #2
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,263
    Plugin Contributions
    3

    Default Re: Question about session id

    You must remove the session ID number from url's you intend to provide as links. This number is generated to identify a specific user and to record their "actions" while on your site.

    You should also configure your sessions:

    admin>>>sessions>>>prevent sipder sessions (set to TRUE).
    20 years a Zencart User

  3. #3
    Join Date
    Jun 2008
    Posts
    61
    Plugin Contributions
    1

    Default Re: Question about session id

    Yes, the hardcoded links are without IDs of course. Was wondering if it's ok if i hardcode links this way? As some system generated links will have ID appended and my hardcoded links will not have the ID.

    Also, I don't see how the "prevent sipder sessions" setting is related?

  4. #4
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,263
    Plugin Contributions
    3

    Default Re: Question about session id

    Quote Originally Posted by yonghs View Post
    Yes, the hardcoded links are without IDs of course. Was wondering if it's ok if i hardcode links this way? As some system generated links will have ID appended and my hardcoded links will not have the ID.
    If the link is internal, then you just need the part that starts with "index.php?....."

    Quote Originally Posted by yonghs View Post
    Also, I don't see how the "prevent sipder sessions" setting is related?
    You are correct - not related to the above, but as your post was about session ID's I though this may be a helpful reminder. If a spider trawls your site and indexes the pages, it might grab (and index) the session ID as well.
    20 years a Zencart User

  5. #5
    Join Date
    Jun 2008
    Posts
    61
    Plugin Contributions
    1

    Default Re: Question about session id

    Thanks a lot.

    The Prevent Spider Session is TRUE by default :)

  6. #6
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Question about session id

    WAIT

    You should ALWAYS let Zen Cart append the zenid on any URL links it generates to its own ("internal" as referenced earlier) pages.

    The zenid parameter is ONLY added by Zen Cart when the visitor's browser has not yet set a cookie to track that session ID. For most people, the 2nd click anywhere on your site causes the zenid parameters to disappear because the cookie has been set and takes over instead. If it doesn't disappear, then the server was unable to set an identifiable cookie in the browser, and thus it knows it needs to keep identifying its connection ... otherwise the customer will not be able to log in.


    schoolboy is correct on one point for sure: do not ever post a URL containing a zenid when posting to a forum or into a newsletter or email you plan to send out ... otherwise everyone who clicks it could jump into each other's shopping session, and you'll end up with angry customers.

    But hardcoding internal links to never show the zenid is ill-advised.
    .

    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.

  7. #7
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,263
    Plugin Contributions
    3

    Default Re: Question about session id

    Quote Originally Posted by DrByte View Post
    But hardcoding internal links to never show the zenid is ill-advised.
    Absolutely... and I should have made myself more clear on this. My advice relates only to internal URL's you may want to "embed" within (for example), your defined pages text, or an ez-page.
    20 years a Zencart User

 

 

Similar Threads

  1. v137 Whoops! Your session has expired. Session Question.
    By weblamer in forum Upgrading to 1.5.x
    Replies: 5
    Last Post: 7 Jun 2015, 07:20 PM
  2. v153 Problem about Adjusting Customer Session
    By macbookpro in forum General Questions
    Replies: 1
    Last Post: 2 Mar 2015, 06:05 PM
  3. General Q about Session and Counts
    By alinabrai in forum General Questions
    Replies: 0
    Last Post: 27 Jan 2011, 05:21 PM
  4. Questions about user session timeouts
    By bodyjewelrystores in forum General Questions
    Replies: 2
    Last Post: 30 Mar 2008, 08:01 PM

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