473,320 Members | 1,900 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Reading the cookies in ASP.NET

Guys,
I am having trouble in reading the cookies in ASP.NET which is written
through the classic ASP page. When I write the cookie in ASP.NET and
try to read the cookie in ASP.NET it works. But if I write through
classic ASP and try to read it in ASP.NET it is not working. Any
ideas.
Thanks in advance
Priya
Nov 18 '05 #1
5 1336
I don't think you can mix cookies from ASP and ASP.NET

"Priya" <pr*******@hotmail.com> wrote in message
news:8f**************************@posting.google.c om...
Guys,
I am having trouble in reading the cookies in ASP.NET which is written
through the classic ASP page. When I write the cookie in ASP.NET and
try to read the cookie in ASP.NET it works. But if I write through
classic ASP and try to read it in ASP.NET it is not working. Any
ideas.
Thanks in advance
Priya

Nov 18 '05 #2
I use something like this (in a WebRequest/WebResponse). Maybe it will be of
some help

dim i as int32
for i = 0 to mgWebResponse.cookies.count - 1
dim hc as httpcookie
hc = new httpcookie(mgWebResponse.cookies.item(i).name)
hc.value= mgWebResponse.cookies.item(i).value.tostring()
hc.expires = datetime.now.adddays(2)
hc.path = mgWebResponse.cookies.item(i).path
HttpContext.Current.Response.AppendCookie(hc)
next i
"Priya" <pr*******@hotmail.com> wrote in message
news:8f**************************@posting.google.c om...
Guys,
I am having trouble in reading the cookies in ASP.NET which is written
through the classic ASP page. When I write the cookie in ASP.NET and
try to read the cookie in ASP.NET it works. But if I write through
classic ASP and try to read it in ASP.NET it is not working. Any
ideas.
Thanks in advance
Priya

Nov 18 '05 #3
This link may help also

http://www.codeproject.com/aspnet/aspnetcookies.asp

"Priya" <pr*******@hotmail.com> wrote in message
news:8f**************************@posting.google.c om...
Guys,
I am having trouble in reading the cookies in ASP.NET which is written
through the classic ASP page. When I write the cookie in ASP.NET and
try to read the cookie in ASP.NET it works. But if I write through
classic ASP and try to read it in ASP.NET it is not working. Any
ideas.
Thanks in advance
Priya

Nov 18 '05 #4
That worked thanks a lot !!
Priya

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #5
Priya Ramamoorthy <pr*******@hotmail.com> wrote in message news:<#E*************@TK2MSFTNGP11.phx.gbl>...
That worked thanks a lot !!
Priya

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

I will take my word back. I am unable to read the cookie written
through ASP from ASP.NET. I know I need to set the path of cookie
correctly.
When I set the path of my Cookie Response.Cookie("Test").Path = "/" in
ASP and try to read in ASP.NET it says nothing has been set. When I
tried to set the path to the other folder in ASP.NET for ex
Dim Cookie as HttpCookie = Request.Cookies("Test")
Cookie.Path = "/test"

I am getting a error "Object reference not set to an instance of an
object"

Help please
Thanks
Priya
Nov 18 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Google Mike | last post by:
Tell me if this can be done, and if I have a misconception here. I am writing an app that will be served up in an app farm, and therefore I need to move the session information to the client, not...
2
by: Robert Jackson | last post by:
Hi, I'm creating an asp.net page that uplogin creates a cookie and then redirects them to a second page that reads the cookie. It's works on some computers and others it doesn't. I know the...
4
by: Gridlock | last post by:
I'm trying to read the cookies using HttpContext.Current.Request.Cookies, but the only cookie that I get is the ASP.NET SessionId cookie. There are many cookies on the machine, why am I only...
9
by: Mike Reed | last post by:
I must be having a "senile" day! I cannot recall, nor get to work, code to read a cookie's expiration date/time in an ASP page/VBScript. What am I missing? *** Sent via Developersdex...
7
by: Nez | last post by:
Help needed! Hello, I have looked everywhere for a solution to my problem and this is pretty much my last resource. I have created a table in a span with the innerhtml command in my code behind....
29
by: Jerim79 | last post by:
I did try to find the answer to this before posting, so this isn't a knee jerk reaction. What I am trying to accomplish is to have a script that opens a cookie, reads a value, and then use a...
3
by: user | last post by:
Hi everyone, May I know the standard way of reading in cookies in ASP.net using VB.net? In classic asp, i can do this: If request.cookies("user") = "abc" then blah blah
3
by: ramesh.nrk | last post by:
Hi, Is there any way to read the cookies which are in local machine? Can we create cookies using windows Application in the local machine? I am developing a windows application which needs...
3
by: jacusp | last post by:
Hi, I have problem with reading cookies. I'd like to save fields of my form into cookies and use them by another page. I save cookies: foreach ($_POST as $idx =$value) { setcookie($idx,...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.