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

Problem writing cookie when supplying Path property

Hi,
I've been having problem writing a cookie. Everything goes ok but when I
supply the .Path property to "/" It just write the cookie when there is no
cookie present, but when I try to update the cookie (or overwrite the cookie)
it doesnt change it.
My requirement to supply the path to "/" because ASP.NET reads it. If I
write the cookie without supplying the path, the ASP.NET pages are unable to
read the cookie.
Any help on this would be appreciated.

Thanks in advance,

Syed Ghayas
Nov 19 '05 #1
2 1250
Can you show us the code you're using to write the cookie as well as the
code you're using to update it and read it?

Ray at work

"Syed Ghayas" <Syed Gh****@discussions.microsoft.com> wrote in message
news:14**********************************@microsof t.com...
Hi,
I've been having problem writing a cookie. Everything goes ok but when I
supply the .Path property to "/" It just write the cookie when there is no
cookie present, but when I try to update the cookie (or overwrite the cookie) it doesnt change it.
My requirement to supply the path to "/" because ASP.NET reads it. If I
write the cookie without supplying the path, the ASP.NET pages are unable to read the cookie.
Any help on this would be appreciated.

Thanks in advance,

Syed Ghayas

Nov 19 '05 #2
Thanks for your interest.Here is the Code in ASP
ASP Code:
Response.Cookies("MyCookie")("Value")="ASP Cookie"
Response.Cookies("MyCookie").Path = "/"

here I am reading that cookie

..Net Code:
HttpContext.Current.Server.UrlDecode(Request.Cooki es["MyCookie"]["Value"]);

Problem occur when I update cookie in ASP, and if I didn't mention the Path
of the Cookie ASP updates the cookie but .Net return null.

"Ray Costanzo [MVP]" wrote:
Can you show us the code you're using to write the cookie as well as the
code you're using to update it and read it?

Ray at work

"Syed Ghayas" <Syed Gh****@discussions.microsoft.com> wrote in message
news:14**********************************@microsof t.com...
Hi,
I've been having problem writing a cookie. Everything goes ok but when I
supply the .Path property to "/" It just write the cookie when there is no
cookie present, but when I try to update the cookie (or overwrite the

cookie)
it doesnt change it.
My requirement to supply the path to "/" because ASP.NET reads it. If I
write the cookie without supplying the path, the ASP.NET pages are unable

to
read the cookie.
Any help on this would be appreciated.

Thanks in advance,

Syed Ghayas


Nov 19 '05 #3

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

Similar topics

10
by: Tony Archer | last post by:
Gentlemen, your urgent help is needed in solving a STRANGE problem. I have two servers a dev box, and a production box. On the dev box everything works fine, in production it hoses: One of...
1
by: Satinderpal Singh | last post by:
Hi everyone, We are using HttpWebRequest to create a request to a URI, which requires us to login first. In order to process all the transactions, first we have to login and get the cookie value...
2
by: Syed Ghayas | last post by:
Hi, I've been having problem writing a cookie. Everything goes ok but when I supply the .Path property to "/" It just write the cookie when there is no cookie present, but when I try to update the...
11
by: ElmoWatson | last post by:
I tried on the Security newgroup, as well as other places, and haven't gotten an answer yet - - I'm pulling my hair out over this one. I'm trying to get Forms Authentication working.....I can get...
4
by: Ivan Demkovitch | last post by:
Hi! From what I understand cookies could be persisted or in-memory. I need to set second one... This code: Response.Cookies.Value = Server.UrlEncode(phpC); Response.Cookies.Path = "/";...
3
by: rss | last post by:
SUMMARY: ========== I am unable to pass along a simple Cookie obtained from a HttpWebRequest call (Machine A's ASP.NET app) so that another Web Server (Machine B) recongnizes the cookie. I...
1
by: segue | last post by:
Hi; I'm looking for the cookie in my personalfolder directory that I thought this postback code should create. Dim MyCookieCollection As New HttpCookieCollection Dim MyCookie As New...
5
by: Bill Nicholson | last post by:
Maybe I don't understand cookies correctly. When some visits my site and logs in, they get a cookie that stores their login information. When they come back, that info is read from the cookie and...
4
by: =?Utf-8?B?YW5vb3A=?= | last post by:
hello, I am writing the Following coding for preventing Session Fixation attack in ASP.Net website, but I could not retrieve the cookie added and the value of cookie_value remains blank. ...
2
by: arijitdas | last post by:
Hi, We have an ASP.NET 2.0 web application where we want to share few user specific data between server and client side code using cookie. We are seeing a very strange behavior that it does not...
1
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: 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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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...

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.