Wrox Programmer Forums
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 5th, 2005, 01:33 PM
Registered User
 
Join Date: May 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Cookie Updating in ASP.NET

I am currently working on a site coded in VB.NET that will take an existing cookie set under the default domain (i.e. something.google.com), save the values in the cookie, delete the original cookie* and rebuild the cookie with the site's primary domain (i.e. google.com).

*Using the below code to delete the cookie from the user's machine:
  Response.Cookies("myCookie").Expires = DateTime.Now.AddDays(-1)
  Response.Cookies.Add(Request.Cookies("myCookie"))

I accomplish all of the above from within the Global.asax.vb file within the session_start method. The problem I'm experiencing is that, upon opening the site, the cookie is changed. However, in order for the controls accessing the cookie* to display properly, I must end the current session and reload the site.

*Accessing the cookie with the below code:
  If (Request.Cookies.Item("myCookie") Is Nothing = False) Then
    'control manipulation code
  End If

Is there a way around having to reload the session and have the new cookie under the primary domain be read 'on the fly' so to speak? Any help or references would be appreciated.

 
Old May 5th, 2005, 06:55 PM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

This is the classic ASP area of the forum - try the .net area.

Wind is your friend
Matt





Similar Threads
Thread Thread Starter Forum Replies Last Post
ASP.NET 2.0 Updating Database Record columth06 ASP.NET 2.0 Basics 0 November 4th, 2006 07:43 AM
Error in updating the Views through ASP.Net App. pavanp ASP.NET 1.0 and 1.1 Professional 0 September 7th, 2004 01:47 AM
Accessing .asp cookie from ASP.net ksams General .NET 4 July 7th, 2004 02:34 AM
Cookie btw. ASP and .NET collie VB.NET 2002/2003 Basics 5 November 10th, 2003 09:38 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.