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

asp.net 2 @ client coockies

i am trying to use this code:
Expand|Select|Wrap|Line Numbers
  1. If (True = Request.Browser.Cookies) Then ' this works!
  2. Dim testCookie As New HttpCookie("LastVisited")
  3. testCookie.Values.Add("time is now", DateTime.Now.ToString)
  4. testCookie.Expires = DateTime.Now.AddDays(20)
  5. testCookie.Domain = "localhost"
  6. Response.AppendCookie(testCookie)
  7. end if
  8.  
to save a coockie on a localhost and it isnt working.
what am i doing wrong?
what if i put the prject on a temp server can i then write a coockie even if
i dont have a domain?
under which name will i see it in the Temporary Internet Files folder?
and should i use the above code for a new coockie and for an existing coocike?
or shouldi use somme diffrent code?

thnaks in advance
peleg
Aug 17 '07 #1
5 1331
I'd set the path property to "/" and leave off the localhost "domain". See if
that helps.
Peter
--
Recursion: see Recursion
site: http://www.eggheadcafe.com
unBlog: http://petesbloggerama.blogspot.com
BlogMetaFinder: http://www.blogmetafinder.com

"pelegk1" wrote:
i am trying to use this code:
Expand|Select|Wrap|Line Numbers
  1.  If (True = Request.Browser.Cookies) Then ' this works!
  2. Dim testCookie As New HttpCookie("LastVisited")
  3.             testCookie.Values.Add("time is now", DateTime.Now.ToString)
  4.             testCookie.Expires = DateTime.Now.AddDays(20)
  5.             testCookie.Domain = "localhost"
  6.             Response.AppendCookie(testCookie)
  7. end if
  8.  
to save a coockie on a localhost and it isnt working.
what am i doing wrong?
what if i put the prject on a temp server can i then write a coockie even if
i dont have a domain?
under which name will i see it in the Temporary Internet Files folder?
and should i use the above code for a new coockie and for an existing coocike?
or shouldi use somme diffrent code?

thnaks in advance
peleg
Aug 18 '07 #2
thnaks alot the path did it!

"Peter Bromberg [C# MVP]" wrote:
I'd set the path property to "/" and leave off the localhost "domain". See if
that helps.
Peter
--
Recursion: see Recursion
site: http://www.eggheadcafe.com
unBlog: http://petesbloggerama.blogspot.com
BlogMetaFinder: http://www.blogmetafinder.com

"pelegk1" wrote:
i am trying to use this code:
Expand|Select|Wrap|Line Numbers
  1.   If (True = Request.Browser.Cookies) Then ' this works!
  2.  Dim testCookie As New HttpCookie("LastVisited")
  3.              testCookie.Values.Add("time is now", DateTime.Now.ToString)
  4.              testCookie.Expires = DateTime.Now.AddDays(20)
  5.              testCookie.Domain = "localhost"
  6.              Response.AppendCookie(testCookie)
  7.  end if
  8.  
to save a coockie on a localhost and it isnt working.
what am i doing wrong?
what if i put the prject on a temp server can i then write a coockie even if
i dont have a domain?
under which name will i see it in the Temporary Internet Files folder?
and should i use the above code for a new coockie and for an existing coocike?
or shouldi use somme diffrent code?

thnaks in advance
peleg
Aug 18 '07 #3
first thnaks alot
but if say i dont work on localhost but on ip with no domain yet,shold i do
the same?

"Peter Bromberg [C# MVP]" wrote:
I'd set the path property to "/" and leave off the localhost "domain". See if
that helps.
Peter
--
Recursion: see Recursion
site: http://www.eggheadcafe.com
unBlog: http://petesbloggerama.blogspot.com
BlogMetaFinder: http://www.blogmetafinder.com

"pelegk1" wrote:
i am trying to use this code:
Expand|Select|Wrap|Line Numbers
  1.   If (True = Request.Browser.Cookies) Then ' this works!
  2.  Dim testCookie As New HttpCookie("LastVisited")
  3.              testCookie.Values.Add("time is now", DateTime.Now.ToString)
  4.              testCookie.Expires = DateTime.Now.AddDays(20)
  5.              testCookie.Domain = "localhost"
  6.              Response.AppendCookie(testCookie)
  7.  end if
  8.  
to save a coockie on a localhost and it isnt working.
what am i doing wrong?
what if i put the prject on a temp server can i then write a coockie even if
i dont have a domain?
under which name will i see it in the Temporary Internet Files folder?
and should i use the above code for a new coockie and for an existing coocike?
or shouldi use somme diffrent code?

thnaks in advance
peleg
Aug 18 '07 #4
re:
!if say i dont work on localhost but on ip with no domain yet,shold i do the same?

Yes. Setting the path to "/" will do it for you.


Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
"pelegk1" <pe*****@discussions.microsoft.comwrote in message
news:A3**********************************@microsof t.com...
first thnaks alot
but if say i dont work on localhost but on ip with no domain yet,shold i do
the same?

"Peter Bromberg [C# MVP]" wrote:
>I'd set the path property to "/" and leave off the localhost "domain". See if
that helps.
Peter
--
Recursion: see Recursion
site: http://www.eggheadcafe.com
unBlog: http://petesbloggerama.blogspot.com
BlogMetaFinder: http://www.blogmetafinder.com

"pelegk1" wrote:
i am trying to use this code:
Expand|Select|Wrap|Line Numbers
  1.  If (True = Request.Browser.Cookies) Then ' this works!
  2. Dim testCookie As New HttpCookie("LastVisited")
  3.             testCookie.Values.Add("time is now", DateTime.Now.ToString)
  4.             testCookie.Expires = DateTime.Now.AddDays(20)
  5.             testCookie.Domain = "localhost"
  6.             Response.AppendCookie(testCookie)
  7. end if
  8.  
to save a coockie on a localhost and it isnt working.
what am i doing wrong?
what if i put the prject on a temp server can i then write a coockie even if
i dont have a domain?
under which name will i see it in the Temporary Internet Files folder?
and should i use the above code for a new coockie and for an existing coocike?
or shouldi use somme diffrent code?

thnaks in advance
peleg

Aug 18 '07 #5
great thnaks alot!

"Juan T. Llibre" wrote:
re:
!if say i dont work on localhost but on ip with no domain yet,shold i do the same?

Yes. Setting the path to "/" will do it for you.


Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
"pelegk1" <pe*****@discussions.microsoft.comwrote in message
news:A3**********************************@microsof t.com...
first thnaks alot
but if say i dont work on localhost but on ip with no domain yet,shold i do
the same?

"Peter Bromberg [C# MVP]" wrote:
I'd set the path property to "/" and leave off the localhost "domain". See if
that helps.
Peter
--
Recursion: see Recursion
site: http://www.eggheadcafe.com
unBlog: http://petesbloggerama.blogspot.com
BlogMetaFinder: http://www.blogmetafinder.com

"pelegk1" wrote:

i am trying to use this code:
Expand|Select|Wrap|Line Numbers
  1.   If (True = Request.Browser.Cookies) Then ' this works!
  2.  Dim testCookie As New HttpCookie("LastVisited")
  3.              testCookie.Values.Add("time is now", DateTime.Now.ToString)
  4.              testCookie.Expires = DateTime.Now.AddDays(20)
  5.              testCookie.Domain = "localhost"
  6.              Response.AppendCookie(testCookie)
  7.  end if
  8.  
to save a coockie on a localhost and it isnt working.
what am i doing wrong?
what if i put the prject on a temp server can i then write a coockie even if
i dont have a domain?
under which name will i see it in the Temporary Internet Files folder?
and should i use the above code for a new coockie and for an existing coocike?
or shouldi use somme diffrent code?

thnaks in advance
peleg


Aug 18 '07 #6

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

Similar topics

5
by: Matt | last post by:
I think this is the basic concept in ASP server-side development. My boss told me web application is NOT client-server application. I argued with him because browser is the client, and the server...
15
by: Michael Rybak | last post by:
hi, everyone. I'm writing a 2-players game that should support network mode. I'm now testing it on 1 PC since I don't have 2. I directly use sockets, and both client and server do...
18
by: cjl | last post by:
Hey all: I know that it is silly in the age of Google to 'lose' something on the internet, but I recently checked out a project that had implemented a database with a subset of SQL in pure...
2
by: Raquel | last post by:
How do I know whether the 'runtime client' and the 'application development client' are installed on my machine? When I issue the command "db2licm -l", it gives the following output: Product...
6
by: Ken Allen | last post by:
I am relatively new to .Net and C#, but I hav ebeen programing in other languages and done some COM work for a number of years. I am attempting to understand how to map an older program...
4
by: rs | last post by:
how I the client tell the server that the socket is closed? or this there an even that informs the server that the clients socket is close? Oh, I am using vb.net 2003 Thanks
2
by: J Huntley Palmer | last post by:
I am having a horrific time integrating uw-imap's c-client for imap support in php. The problem is a whole bunch of "Text relocation remains referenced against symbol" errors during linking....
0
by: khu84 | last post by:
Here is client server very simple code, seems to work with telnet but with with web client code gives blank output. Following is the server code:- <?php function...
2
by: nsaffary | last post by:
hi I hava a client/server program that run correctly when i run it in one computer(local) but when I run client on a one computer and run server run on another, connection does not stablish.(I set...
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: 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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
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,...
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...

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.