ASP Cookies

This is a discussion on "ASP Cookies" within the Classic ASP section. This forum, and the thread "ASP Cookies are both part of the Program Your Website category.


 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Program Your Website > Classic ASP

Notices




Closed Thread
 
LinkBack Thread Tools
  #1  
Old Nov 12th, 2003, 19:07
Junior Member
Join Date: Oct 2003
Location: United Kingdom
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
ASP Cookies

Hi im trying to add a cookie to a clients machine but the code i have fails to work why !!

I test it on my machine and no cookie is set even though i accept all cookies during this testing

please help and here is the code

Code: Select all
Response.Cookies("User_Info")("uname") = "personz"
Thanks all
Sam Lad
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!

  #2  
Old Nov 12th, 2003, 19:10
Reputable Member
Join Date: Aug 2003
Location: United Kingdom
Posts: 341
Thanks: 0
Thanked 0 Times in 0 Posts
Try it without the underscore in User_Info... maybe...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #3  
Old Nov 12th, 2003, 19:23
Junior Member
Join Date: Oct 2003
Location: United Kingdom
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
No luck still wont work
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #4  
Old Nov 12th, 2003, 21:46
Junior Member
Join Date: Nov 2003
Location: United Kingdom
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
How do you know it isn't working? Have you tried reading it back in, or are you searching for it in your cookies folder?

Try this

Code: Select all
<%
'this writes the cookie
Response.Cookies("User_Info")("uname") = "personz"

'this reads the cookie and writes it to the screen
Response.Write (Request.Cookies("User_Info")("uname"))
%>
If you see personz then the cookie is working. You may want to think about setting a bit more detail with the cookie like how long it should last otherwise it will expire with the session - or when the browser is closed.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #5  
Old Nov 13th, 2003, 08:44
Highly Reputable Member
Join Date: Jul 2003
Location: Ipswich, UK
Posts: 690
Thanks: 0
Thanked 0 Times in 0 Posts
are you testing this local? running IIS or PWS on your machine? Are you using IE6? you may find your browser isnt excepting the cookie. Try viewing it from http://127.0.0.1 instead of http://localhost
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #6  
Old Nov 18th, 2003, 14:37
Junior Member
Join Date: Aug 2003
Location: United Kingdom
Posts: 48
Thanks: 0
Thanked 0 Times in 0 Posts
<blockquote id="quote"><font size="1" face="geneva, verdana, arial" id="quote">quote:<hr height="1" noshade id="quote">Originally posted by devman

How do you know it isn't working? Have you tried reading it back in, or are you searching for it in your cookies folder?

Try this

Code: Select all
<%
'this writes the cookie
Response.Cookies("User_Info")("uname") = "personz"

'this reads the cookie and writes it to the screen
Response.Write (Request.Cookies("User_Info")("uname"))
%>
If you see personz then the cookie is working. You may want to think about setting a bit more detail with the cookie like how long it should last otherwise it will expire with the session - or when the browser is closed.

<hr height="1" noshade id="quote"></blockquote id="quote"></font id="quote">

woh woh, slow down their bucko. You aren't suggesting the lump of code is done on one page, are you? Naturally with cookies you need to test it on another page - cookies require a trip back to the user before being able to read them, as cookies are stored on the users machine. So doing that code on one page is not the way of checking that cookies are working. Try disabling cookies in your browser and running that code. Note that it'll still write out 'personz' to the screen.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #7  
Old Nov 22nd, 2003, 14:04
Junior Member
Join Date: Nov 2003
Location: United Kingdom
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Maybe I was being a little too quick to jump in - hell i only wanted to help.

I guess what I wanted to know was how he knew it wasn't working, but it seems that señorbadger must have solved his problems as he hasn't been back to say anything else.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Closed Thread

Tags
asp, cookies

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] cookies... please help!!!! earl080688 PHP Forum 4 Jan 14th, 2008 05:51
cookies in PHP marquey PHP Forum 4 May 31st, 2007 17:17
how to store cookies selphie08 Flash & Multimedia Forum 3 Sep 20th, 2006 01:54
Flash+cookies icthecat Flash & Multimedia Forum 1 Oct 31st, 2003 06:32


All times are GMT. The time now is 12:32.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42