473,473 Members | 1,764 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Cookie set, but not passing to the next page.

2 New Member
I'm setting a cookie to store a username for an extended period of time.

Expand|Select|Wrap|Line Numbers
  1. 'If the user requested to be remembered...
  2. If memory = 1 Then
  3. Response.Cookies("Username") = rsLogin.Fields.Item("Username").Value
  4. Response.Cookies("Username").Expires= Date() + 7
  5. Session.Contents.Remove("Username")
  6. Else
  7.  
  8. 'If the user did not request to be remembered...
  9. Session("Username") = rsLogin.Fields.Item("Username").Value
  10. Response.Cookies("Username") = ""
  11.  
  12. End If
Due to the problem, I test it like this...

Expand|Select|Wrap|Line Numbers
  1. Response.Write("cookie -> " & Request.Cookies("Username") & "<br><br>")
  2. Response.Write("<a href=""test.asp"">test.asp</a>")
Which gives me the output

cookie -> jimjazz

test.asp

Next, I click on the "test.asp" link. On the test.asp page, I run the same test code..

Expand|Select|Wrap|Line Numbers
  1. Response.Write("cookie -> " & Request.Cookies("Username") & "<br><br>")
And it gives the output:

cookie ->

What gives?

(these are results for IE8, everything seems to work fine in FF3.5, but 98% of all my users are IE)
Feb 22 '10 #1
2 1690
JimJazz
2 New Member
Oh... and I've set my IE permissions to "override automatic cookie handling" and accept everything. No dice.

Why can't everyone just use firefox and make me happy?
Feb 22 '10 #2
jhardman
3,406 Recognized Expert Specialist
hey Jim, try this:
Expand|Select|Wrap|Line Numbers
  1. <%
  2. dim x,y
  3. for each x in Request.Cookies
  4.   response.write("<p>")
  5.   if Request.Cookies(x).HasKeys then
  6.     for each y in Request.Cookies(x)
  7.       response.write(x & ":" & y & "=" & Request.Cookies(x)(y))
  8.       response.write("<br />")
  9.     next
  10.   else
  11.     Response.Write(x & "=" & Request.Cookies(x) & "<br />")
  12.   end if
  13.   response.write "</p>"
  14. next
  15. %>
What does this give you?

Jared
Feb 23 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Geoff May | last post by:
I'm busy rewriting by F1 database and I want to use cookies to store various user definable views, (basically so that when the visitor returns to a specific page, that page will redisplay in the...
5
by: Fred | last post by:
I've check all the info I can find on cookies and I have gotten some idea of how to set a cookie, set the expiration, and get the cookie value. But I need help bringing it all together to...
4
by: Wally | last post by:
I have a record set (rs) that contains 25 barcodes values that I set to true in a cookie. (see code section below) If I read the cookie from within the same page that created it, I see all 25...
9
by: Don | last post by:
I understand that when I send a cookie in a client-side page containing JS, it isn't actually "set" until the next page is loaded. Is there some way to "set" it within the same html/JS page so it...
7
by: ehendrikd | last post by:
hi all i need some clarification on how the php session work in relation to cookies. we have a web site where users need to log in. a few of our users were having troubles with their browser...
1
by: Joe | last post by:
Hi folks, Been looking at this for the day so any ideas would be appreciated. Here's the scenario, bear with me - it looks more complicated than it is :) I have a page templating system that...
4
by: 23s | last post by:
I had this problem in the past, after a server reformat it went away, and now after another server reformat it's back again - no clue what's doing it. Here's the flow: Website root is public, no...
1
by: BJörn Lindqvist | last post by:
Hello, I have some very serious trouble getting cookes to work. After a lot of work (urllib2 is severly underdocumented, arcane and overengineerd btw) I'm finally able to accept cookes from a...
2
by: rn5a | last post by:
A web.config file has the following code: <configuration> <system.web> <authentication mode="Forms"> <forms name="NETConnectCookie" loginUrl="Login.aspx"> <credentials passwordFormat="SHA1"/>...
2
by: HopfZ | last post by:
Server sends cookie to browser and the browser send the same cookie back to the server according to Wikipedia. Do browsers send even javascript-generated cookie to servers? For example, if I...
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...
1
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,...
1
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...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
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 ...

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.