Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Using Modules a...Using Modules a...Creating a cookie in DNNCreating a cookie in DNN
Previous
 
Next
New Post
1/31/2012 7:25 PM
 

I am using DNN 6.x and I need to track a code from a landing page to registration into a system I built.

Here is the code that I am using in the load of the Module:
Response.Cookies("REGCODE").Value = "GoogleAdMay2012"
Response.Cookies("REGCODE").Expires = DateTime.Now.AddDays(150) 

But when I call for that code on another page it is empty.

I can write the value of the cookie to the browser on the same page with the same code below. This, however, does not work when going from one page to another.

 Response.Write(Response.Cookies("REGCODE").Value)

Is there a setting that I can change where this will work, or am I doing something wrong? using a cookie should be the easiest thing ever, yet this is not working.

 
New Post
1/31/2012 8:20 PM
 

Remember that when you are reading from a cookie on another page you need to access the Cookies collection of the HttpRequest object, not the HttpResponse object:

If Not Request.Cookies("REGCODE") Is Nothing Then
     txtBoxControl.Text = Request.Cookies("REGCODE").Value
End If

Here's a brief tutorial on ASP.Net and cookie handling that may be of help:

http://msdn.microsoft.com/en-us/libra...


Bill, WESNet Designs
Team Lead - DotNetNuke Gallery Module Project (Not Actively Being Developed)
Extensions Forge Projects . . .
Current: UserExport, ContentDeJour, ePrayer, DNN NewsTicker, By Invitation
Coming Soon: FRBO-For Rent By Owner
 
New Post
2/1/2012 9:23 PM
 
Wow, I feel like a fool. I was pulling the response.. silly copy paste. Thanks.
 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Using Modules a...Using Modules a...Creating a cookie in DNNCreating a cookie in DNN


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out