473,705 Members | 6,195 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Reading Cookies only returning SessionId cookie

I'm trying to read the cookies using HttpContext.Cur rent.Request.Co okies, but
the only cookie that I get is the ASP.NET SessionId cookie. There are many
cookies on the machine, why am I only getting the one cookie?

Thanks,

- Stew

Dec 19 '05 #1
4 1663
your browser only sends up the cookies for your site (yourhost.com for
example)

Dec 19 '05 #2
Hi Stew,
Sorry, but cookies are not cross domain. A cookies written by Microsoft on a
client browser when you go on Microsoft Sites can't be read by Oracle when
you go on Oracle Site...
Cookies writtent by an application could be readen by another application
hosted with the same domain, for examples : www.microsoft.com/toto and
www.microsoft.com/titi
If you want to read permanent cookies written on a client machine, you could
read the following folder : C:\Documents and Settings\YourLo ginNale\Cookies

--
Daniel TIZON
MCP - MCSD.NET - MCT

"Gridlock" <Gr******@discu ssions.microsof t.com> a écrit dans le message de
news: E7************* *************** **...icrosof t.com...
I'm trying to read the cookies using HttpContext.Cur rent.Request.Co okies,
but
the only cookie that I get is the ASP.NET SessionId cookie. There are many
cookies on the machine, why am I only getting the one cookie?

Thanks,

- Stew

Dec 19 '05 #3
Yes, thank you, I realized that afterward. I am still having a problem though:

First of all I'm in a development environment, so the site name would just
be http://localhost. I am trying to write a cookie using the following code:

public static void Write( string cookieName, string cookieValue )
{
HttpCookie cookie = new HttpCookie( cookieName, cookieValue );
cookie.Expires = DateTime.Now.Ad dYears(1);
HttpContext.Cur rent.Response.C ookies.Add( cookie );
}

The problem is that the cookie is only available for the time the browser is
open, it's not there the next time I try to read it, even though I've set an
expiration date.

The second issue, is there is another application that is creating a cookie
(an ASP app), which I need to read back. That application is redirecting to
my application )ASP.NET app), which exists on the same server, and is 'part'
of the ASP app in IIS. I can't seem to be able to read the cookie (not part
of Cookie collection) in my APS.NET app. Any ideas on this?

Thanks much

Dec 20 '05 #4
Thank you Daniel... I did realize that after I posted a message. Please
check my response to the other poster above.

The main problem is being able to read a cookie created by the 'parent'
application, which is on the same domain. An ASP application is writing a
cookie, then redirecting to my ASP.NET home page. At that point, I need to
read back the cookie that the ASP app created. The ASP and ASP.NET
applications are both within the confines of the same parent directory on the
server, yet I still can't read the ASP app's cookie.

Any help would be greatly appreciated.

Thank you
Dec 20 '05 #5

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

Similar topics

4
3699
by: Cezar | last post by:
Hi, does anyone know how to create a login system with PHP that does not use cookies? I am finding that more and more users seem to be setting their privacy settings to high, this not accepting cookies. -- Regards, Caesar. ================================
1
8440
by: Angus SC2 | last post by:
Hi I am trying to set up cross domain cookies on a server I have running that currently has 2 domains running on it (on different IPs). Basically I have a forums site (using UBB threads) and I want to users to be able to use the forum login and password from the main site and then if they go to the forum site they are already logged in to that as well. I have tried followed this article:...
0
14714
by: Maverick | last post by:
Hello all, I read some good reviews about jakarta HTTPClient about its session and cookies management system and fancied giving it a try as a learning exercise but somehow I don't seem to be able to get it to work properly. I'm basically trying to connect to this site http://s1.starkingdoms.com/scripts/main.php I am able to get past the authentication login page onto the next screen but I then can't proceed any further because of...
0
2711
by: bb | last post by:
Hello In my Session_OnStart in Global.asa, I am setting some cookies. One of them, I set as follows: dim UserID UserID = Request.ServerVariables("LOGON_USER") Response.Cookies("User")("ID") = UCASE(UserID) When I immediately log the cookie value retrieved from
3
2635
by: Raghu Raman | last post by:
Hi, I want to store a cookie peemanently for 2 days.From msdn article, i have coded like this.It is working when i run my application .But if i close my browser and restart my application , i could not find the stored cookie,it was gone . my code -----------------
6
3665
by: DJones | last post by:
I'm using the following code in my .Net application (.Net v1.1, Windows 2000) to write Session Cookies. HttpContext.Current.Response.Cookies("cookieSession")("SessionID") = strSessionID HttpContext.Current.Response.Cookies("cookieSession")("Site_ID") = strSite_ID
2
3486
by: Gil Paz | last post by:
Looks like a very simple question, but I don't find the answer. I use ASP.net 2.0 VB, I would like to check if a cookie exist on the clients computer's and if not to create. In order to create a cookie I write: Dim Cookie As HttpCookie = New HttpCookie("UserID") Cookie.Values.Add("SessionID", Session.SessionID) Cookie.Expires = DateTime.Now.AddYears(30) Response.Cookies.Add(Cookie)
3
1971
by: Victor | last post by:
I was thinking about an easy to determine if cookies are set or not in ASP. I began thinking about how the Session ID is dependent upon a cookie - right? Well, I disabled cookies in Firefox and then loaded a webpage that displayed Session.SessionID. Viola, I got one! And then, I reloaded the page. And then, I noticed that the SessionID incremented by one! This still isn't yet a one-page method of detecting if cookies are enabled or not...
2
5008
by: StanB | last post by:
I came across this weird problem: 1. Session state stops working after the app is deployed to another server because IE does not accept cookies. 2. It works if cookieless="true" in the web.config 3. Yes, I tried IE - Tools - Privacy - Accept All Cookies and also Override automatic cookie handling, Always allow session cookes
0
8768
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9274
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9139
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7895
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6606
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5933
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4704
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3138
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2491
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.