473,394 Members | 1,567 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,394 software developers and data experts.

ASP -> ASP.NET Cookie problems, please help!

Thanks for reading. I'm having problems with cookies from asp to asp.net
and back!

It seems like I can set a cookie in asp.net fine, and alter it at will, as
soon as asp touches it, asp.net won't have anything to do with it. Can
someone please help!

The code below, going from aspx to aspx, works great the cookie as expected
goes from qwerty to zxcvb and back. As soon as you hit the asp page, the
cookie goes to asdfg and stays there no matter how many times you hit it
from the aspx pages afterwards.

Please help! I really want to transition slowly to .net, this will hamper
my ability to do that...

Thanks,
Ben

[fooo.aspx.cs]

private void Page_Load(object sender, System.EventArgs e)
{
if (Request.Cookies["Test"] != null &&
Request.Cookies["Test"]["Testing"] != null)
{
Response.Write(Request.Cookies["Test"]["Testing"]);
}
Response.Cookies["Test"]["Testing"] = "qwerty";
Response.Write("<br><a href=\"fooo2.aspx\">zxcvb</a>");
Response.Write("<br><a href=\"foo2.asp\">asdfg</a>");
}

[fooo.aspx.cs]

[fooo2.aspx.cs]
private void Page_Load(object sender, System.EventArgs e)
{
if (Request.Cookies["Test"] != null &&
Request.Cookies["Test"]["Testing"] != null)
{
Response.Write(Request.Cookies["Test"]["Testing"]);
}
Response.Cookies["Test"]["Testing"] = "zxcvb";
Response.Write("<br><a href=\"fooo.aspx\">qwerty</a>");
}
[fooo2.aspx.cs]

[foo2.asp]
<%
Response.Write(Request.Cookies("Test")("Testing"))
Response.Cookies("Test")("Testing") = "asdfg"
Response.Write("<br><a href=""fooo.aspx"">qwerty</a>")
Response.End()
%>

Nov 16 '05 #1
0 1193

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

Similar topics

2
by: Sarah Michael | last post by:
Hi, I am running the following code to set a cookie but it is not working, please help me sorting out the problem. The code is from an online article http://www.devarticles.com/art/1/639 I...
0
by: | last post by:
I''m having a problem with cookies that is driving me insane :). - If a user comes to http://domain.com and a cookie is set for them, then the user for whatever reason jumps to http://www.domain.com...
3
by: Stephanie Stowe | last post by:
Hi. I read in some helpful publication "If a cookie created by a page on catalog.acme.com sets its path attribute to "/" and its domain attrinute to "acme.com", that cookie is available to all...
1
by: Ann and John | last post by:
I understand the limitation of Cookies and how they are written and retrieved - but Is it possible, without client input, to have Cookie Data sent back to be ie Visitor 1 has visited 25 times...
14
by: slim | last post by:
hi all, whilst creating a mock-up site, i am trying to follow the rules and guidelines i have been digesting over the last few months with regards to css positioning and accessibility. well,...
0
by: Eric | last post by:
Visual C++ 2005 Express MVP's and experience programmer's only please!... I need to get the number of lines in a textbox so I can insert them into a listview. The text comes from my database...
4
by: ii2o | last post by:
Hi all, I'm trying to develop a website that selects from 3 stylesheets depending on which style they have chosen. Their preference is stored in a cookie and this is where the problems begin. I...
4
by: rodmc | last post by:
Hi, I am trying to set a cookie on a client computer using the Cookie module however all I get is the text being printed in the browser window. Can anyone point me in the right direction so that...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.