Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB.NET 1.0 > Pro VB.NET 2002/2003
|
Pro VB.NET 2002/2003 For advanced Visual Basic coders working .NET version 2002/2003. Beginning-level questions will be redirected to other forums, including Beginning VB.NET.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro VB.NET 2002/2003 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 November 1st, 2003, 11:18 AM
Authorized User
 
Join Date: Oct 2003
Posts: 89
Thanks: 0
Thanked 0 Times in 0 Posts
Default sharing cookies between asp and vb.net

I have a project that contains asp and .net.
.NET is supposed to receive a cookie from classic ASP.

The problem is that my aspx page doesn't seem to recognise the cookie that it's supposed to receive from classic asp. I receive the line NO COOKIE.
Please someone help.

ASP code:
<%
If Not Request.Form("Name") = "" Then
    Response.Cookies("Name") = Request.Form("Name")

end if
%>
<HTML>

ASPX code:

Imports System.Web.HttpCookie

PAGE_LOAD
IF PAGE.ISPOSTBACK THEN
 If Request.Cookies("Name") Is Nothing Then
                Label1.Text = "NO COOKIE"
            Else
                Dim cookie As HttpCookie
                cookie = New HttpCookie("name")
                cookie.Value = Request.Cookies("Name").Value()
                Response.AppendCookie(cookie)
                Label1.Text = "Cookie already exists : "
                Label1.Text = Label1.Text & Request.Cookies("Name").Value()

            End If
EnD IF


 
Old January 7th, 2004, 02:36 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Is your ASPX and ASP page running in the same application context? If they are running in two different virtual applications, you might have a problem. One thing you can do is set the cookie path to "/" to ensure that it will be visible by all applications on your server (if so desired).

Peter
------------------------------------------------------
Work smarter, not harder.
 
Old April 19th, 2005, 09:08 AM
Registered User
 
Join Date: Apr 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to nicopiace
Default

Hi,
Peter (Planoie), I would like to know if you can help me, you said :

      "If they are running in two different virtual applications, you might have a problem. One thing you can do is set the cookie path to "/" to ensure that it will be visible by all applications on your server (if so desired)."

The thing is that I have an application made in VB.NET and ahnother application made in ASP.NET.
I create a cookie from my VB.NET application and I try to read this cookie from my ASP.NET application and it says

       "Invalid value for 'encryptedTicket' parameter."

It would be great if you can help me.
I ask you another thing is that: if you can answer my to my mail:

nicopiace@hotmail.com

Thanks

Nico



 
Old April 19th, 2005, 10:31 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Your first post indicates the two applications are ASP and ASP.NET. This last one says VB.NET and ASP.NET. Saying VB.NET is meaningless because you can write many different application types in VB.NET, including ASP.NET. Do you mean you have web forms and windows forms applications, both in .NET?

If that's the case, then you'll have problems. A windows forms application is not inherently designed to work with cookies. There is another recent thread on this board dealing with how to read cookies thru the file system.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Sharing session values from an asp.net page? binici ASP.NET 2.0 Basics 4 January 8th, 2007 10:58 AM
ASP.NET Duplicate Cookies Issue jtoth Classic ASP Components 3 March 23rd, 2005 12:28 AM
Sharing arrays between two VB.NET applications Kiza VB.NET 2002/2003 Basics 1 December 16th, 2004 08:33 AM
cookies in asp.net Asteroid ASP.NET 1.0 and 1.1 Basics 1 September 22nd, 2004 07:47 AM





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