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

Home Posts Topics Members FAQ

Using variables within cookies

12 New Member
Hi

I am quite new to ASP coding so I may be going the wrong way about this problem. I want to send a variable over a few pages and thought the best way would be to attach it as a cookie. However, it won't let me set the cookie as a variable.

My Code

' Defining part number as a variable
<% PCBPartNo = request.Form("PCBPartNumber") %>

'Applying variable as cookie
<%
Response.Cookies("PCBPartNumber")= "response.Write(PCBPartNo)"
%>

Thank you
Mar 29 '07 #1
1 981
jhardman
3,406 Recognized Expert Specialist
'Applying variable as cookie
<%
Response.Cookies("PCBPartNumber")= "response.Write(PCBPartNo)"
%>

Thank you
try
Expand|Select|Wrap|Line Numbers
  1. Response.Cookies("PCBPartNumber")= PCBPartNo
also, session-level variables can do a similar thing:
Expand|Select|Wrap|Line Numbers
  1. Session("PCBPartNumber")= PCBPartNo
Let me know if this helps.

Jared
Mar 30 '07 #2

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

Similar topics

0
by: Antwerp | last post by:
Hi, I'm trying to create a perl script that will log into a website (the login form uses POST), navigate to several pages, and append the (html) content parsed from those pages to a seperate log...
3
by: Dave Ainslie | last post by:
How do I send session variables between two web directories? I have two sites on my web server I wish to send cookies between. Thanks in advance Dave
0
by: Glenn Venzke | last post by:
I have an asp classic app running on W2000/IIS 5. To cut down on page reloads, I am using client-side javascript to retreive web content using the "XMLHTTP" active x control. I then populate divs...
8
by: chris_fieldhouse | last post by:
Hi fairly new to php, but picking it up quite well. the question I have, is it possible for a php script which is used to validate values submitted in a form, to then post these values onto...
7
by: isaac2004 | last post by:
hi i have a basic asp page that acts as an online bookstore. on my cart page i am having trouble generating 3 numbers; a subtotal, a shipping total, and a final price. here is my code i would...
5
by: John Scott | last post by:
Ok..this a rather odd question/problem. I haven't really found a straight forward answer to how to handle this scenario, so I hope someone here can help. Here it is: I have an application...
9
by: viz | last post by:
hi, i have written a class for session handling, and i want to use it to keep track of the user. After authenticating the user in login page i am storing the session info like uname etc.. in a...
4
by: leena13 | last post by:
Hi, I am facing a problem of loss of session variables once the ASP.Net 2.0 application is deployed. Let me add that this is actually a 1.1 to 2.0 migration. I found that the first time the...
3
by: BAnderton | last post by:
Hello all, Question: Is there any way to access a javascript variable from within psp code? I'm aware of how to do the reverse of this (js_var='<%=psp_var%>'). Here's a non-working...
3
by: damezumari | last post by:
To find out were session variables are stored I included this instruction in my program: echo ini_get("session.save_path"); The reply was /home/7604/data/tmp which is a folder on my server. I...
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
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
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...
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: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.