R2i DotNetNuke® Forum

R2i wants you to have the opportunity to ask questions, post reviews, help others or just rant and rave about DotNetNuke® or any of the R2i Modules and Skins. Our team spends hour upon hour, day after day, working on custom DotNetNuke® modules and services; please feel free to ask us anything.
 
Create a cookie once only
Last Post 18 Feb 2009 08:52 PM by kschreiner111. 5 Replies.
Printer Friendly
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages Informative
zymmetricalUser is Offline
Basic Member
Basic Member
Posts:141

--
03 Mar 2008 05:08 PM  
I'm using Listx to grab affiliate ID's out of the querystring, for every page on our site. The query variable name is 'ref'.

The following works fine the first time, however on subsequent page loads, the cookie is overwritten with a blank value.

I'm doing a check for the cookies existence in here so I don't follow why it's writing the cookie more than once, can someone help?:

1. If [Userid,System] = -1
2. If [FORMAT,[refid,q],{LENGTH}]<1
3. Assignment: Assign <Session> variable 'sRefID' to '[ref,q]'.
4. Assignment: Assign <Cookie> variable 'refid' to '[sRefID,Session]'.
zymmetricalUser is Offline
Basic Member
Basic Member
Posts:141

--
03 Mar 2008 05:09 PM  
Oops, 2. If [FORMAT,[refid,q],{LENGTH}]<1 should be:

2. If [FORMAT,[refid,q],{LENGTH}]>1

Still, same problem - it's apparently writing the cookie on every page load, and obviuosly without the query variable present it's going to be making a blank cookie. What am I missing?
robert_chumleyUser is Offline
Advanced Member
Advanced Member
Posts:592

--
03 Mar 2008 05:17 PM  
You do know that on step 3 your are referring to a different query string parameter?
Thanks,
Robert Chumley<br>r2integrated (formally bi4ce)
zymmetricalUser is Offline
Basic Member
Basic Member
Posts:141

--
03 Mar 2008 06:47 PM  
Oops yes that's definitely a mistake but it was just relating to the session variable.

I believe I have discovered the problem: I have this Listx in a module that has "Display Module On All Pages?" set on in the module settings.

Once I turned this off and then on again, the new way I have the Listx configured seemed to kick in on all the other pages in the site.
robert_chumleyUser is Offline
Advanced Member
Advanced Member
Posts:592

--
05 Mar 2008 02:56 PM  
Yes, doing this can cause erratic behaviour in ListX. The configuration are tied to a module, so if you make a change in one location, it will change it for all the modules on the site. Just something to keep in mind.
Thanks,
Robert Chumley<br>r2integrated (formally bi4ce)
kschreiner111User is Offline
New Member
New Member
Posts:4

--
18 Feb 2009 08:52 PM  
test
You are not authorized to post a reply.

Active Forums 4.1
 

New York, NY • Baltimore, MD • Vienna, VA • St. Louis, MO • Seatle, WA • 410.327.0007 • info@R2Integrated.com

Bookmark & Share Bookmark and Share