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

save cookie and retrieve in javascript

oranoos3000
107 100+
hi
i want to set cookie with javascript
i use this code
Expand|Select|Wrap|Line Numbers
  1. <script language="javascript">
  2. document.cookie="username='ali'";
  3.  
  4. </script>
with using this code when i look at previous cookie that stored in my computer
i dont this cookie
how do save cookie and retrieve with javasript?
thanks alot for your help
Jun 25 '09 #1
1 5769
acoder
16,027 Expert Mod 8TB
To deal with cookies easily, you need three functions: to save, read and delete. Here are two links which should help:
http://www.quirksmode.org/js/cookies.html
http://www.w3schools.com/JS/js_cookies.asp

PS: use the script type attribute, not the deprecated language attribute:
Expand|Select|Wrap|Line Numbers
  1. <script type="text/javascript">
Jun 26 '09 #2

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

Similar topics

0
by: Phil Powell | last post by:
URL: http://valsignalandet.com/cookiegrab.php?name=valIdentifier This page produces a cookie value and sends it back as HTML using PHP and Javascript to obtain it. This URL will be used as the...
17
by: neerolyte | last post by:
how would i go about setting a cookie in javascript that can be read in javascript on the next page load, but will NOT be passed to the server?
3
by: M Wells | last post by:
Hi All, Just wondering how you go about changing the value of a session cookie via javascript? I have a PHP page that sets a session cookie when it first loads. I'd like to be able to change...
4
by: Larsens | last post by:
Hello I have this in a FORM tag: OnSubmit="return SendForm(this); to save the content of the form in a cookie. But I need to save it a on windows print, where I reload the form with a css for...
9
by: Marco Krechting | last post by:
Hi All, I have a page with a list of hyperlinks. I want to save information in a cookie about the fact that I entered an hyperlink or not. When I click one of the hyperlinks I want this stored...
14
by: Schoo | last post by:
I have an asp.net app that uses session objects (ag. session("UserID")). The app works fine in development/debug mode. I released it to the test server (Windows 2000 server with other .NET...
2
by: Raghu Raman | last post by:
Hi, In javascript file i store 3 values under a single cookie array ,like var myarray = new Array(null); myarray = "field_1"; myarray = "field_2"; myarray = "field_3"; document.cookie...
2
by: Josh T | last post by:
As of now I am setting a cookie on my aspx page via javascript, function SetCookie(cookieName, value, minutesToExpire) { ClearCookie(cookieName); var expireDate = new Date(); var...
2
by: mlevit | last post by:
Hi, I've written my own JavaScript and used a couple of codes to set and get cookies from the net I found. When I set the cookie I can see it in my browser, it is set with the right value and...
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...
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,...
0
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: 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.