473,782 Members | 2,664 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

cookie on browser but not on server

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?
Jul 20 '05 #1
17 1845
On Tue, 6 Jan 2004 16:37:40 +1100, "neerolyte"
<ne*******@nets pace.nOsPaM.net .au> wrote:
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?


Cookies are always sent to the server.

Regards,
Steve
Jul 20 '05 #2
In article <bt**********@o tis.netspace.ne t.au>,
ne*******@netsp ace.nOsPaM.net. au enlightened us with...
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?


Don't use cookies. They are always stored on the server.
You could pass the parameter via the URL and read it in with javascript
if the pages are sequential.

--
--
~kaeli~
In democracy your vote counts. In feudalism your count votes.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 20 '05 #3
kaeli wrote:
You could pass the parameter via the URL and read it in with javascript
if the pages are sequential.

Or even better: store it on the window object, that will remain in tact
between pages, and afaik it's possible to read it from another page (I
assume it should be from the same domain or so) later on.

Cheers,

Guido

Jul 20 '05 #4
How do I use the window object?
I did this as a test:

<script language="JavaS cript">
document.write( window.myVar);
window.myVar = "this is stored?";
document.write( window.myVar);
</script>

the output is ALLWAYS "undefinedt his is stored?"
"Guido Wesdorp" <gu***@infrae.c om> wrote in message
news:3F******** ******@infrae.c om...
kaeli wrote:
You could pass the parameter via the URL and read it in with javascript
if the pages are sequential.

Or even better: store it on the window object, that will remain in tact
between pages, and afaik it's possible to read it from another page (I
assume it should be from the same domain or so) later on.

Cheers,

Guido

Jul 20 '05 #5
> Don't use cookies. They are always stored on the server.
they are stored in the browser!
You could pass the parameter via the URL and read it in with javascript
if the pages are sequential.

passing the parameter via the URL is still passing it to the server, the
problem is that the variable must not pass through the internet.
Jul 20 '05 #6
Hi,

Guido Wesdorp wrote:
kaeli wrote:
You could pass the parameter via the URL and read it in with
javascript if the pages are sequential.

Or even better: store it on the window object, that will remain in tact
between pages, and afaik it's possible to read it from another page (I
assume it should be from the same domain or so) later on.

Cheers,

Guido


The instance of the Window object corresponding to the current
window/frame is renitialized every time that the page is loaded. There
is no persistence.

If you want persistence using a Window object, you must use frames, and
store the variables in the frameset. For example:

top.myVar = "Blabla";

Since the top frameset is not reloaded when you switch frame, the
variable won't be erased.

Laurent
--
Laurent Bugnion, GalaSoft
Software engineering: http://www.galasoft-LB.ch
Private/Malaysia: http://mypage.bluewin.ch/lbugnion
Support children in Calcutta: http://www.calcutta-espoir.ch

Jul 20 '05 #7
In article <bt**********@o tis.netspace.ne t.au>,
ne*******@netsp ace.nOsPaM.net. au enlightened us with...
Don't use cookies. They are always stored on the server.

they are stored in the browser!
You could pass the parameter via the URL and read it in with javascript
if the pages are sequential.

passing the parameter via the URL is still passing it to the server, the
problem is that the variable must not pass through the internet.


Then I'd have to say frames are about it.
Frames are evil, though, and require a lot of coding of workarounds to
deal with issues they cause if they're used on an internet site.

--
--
~kaeli~
Going to church doesn't make you a Christian any more than
standing in a garage makes you a car.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 20 '05 #8
> Then I'd have to say frames are about it.
Frames are evil, though, and require a lot of coding of workarounds to
deal with issues they cause if they're used on an internet site.

hmmm, I don't want to use frames, I've worked out how to achieve the same
thing by using a random variable and retrieving as much client specific info
from the browser as I can, as well as their IP address, this works well, but
being able to store the pass as I wanted to would have given me as close as
you can get with non ssl sites to a secure login
Jul 20 '05 #9
In article <bt***********@ otis.netspace.n et.au>,
ne*******@netsp ace.nOsPaM.net. au enlightened us with...
Then I'd have to say frames are about it.
Frames are evil, though, and require a lot of coding of workarounds to
deal with issues they cause if they're used on an internet site.

hmmm, I don't want to use frames, I've worked out how to achieve the same
thing by using a random variable and retrieving as much client specific info
from the browser as I can, as well as their IP address, this works well, but
being able to store the pass as I wanted to would have given me as close as
you can get with non ssl sites to a secure login


Encrypt the data.
To log in, the user name and password have to go to the server.
Otherwise, how does the server know it's valid? So, I assume you don't
want to send it as plain text, not that you don't want to send it at
all.

I don't know how good this is, but I found this with Google.
http://pajhome.org.uk/crypt/md5/chaplogin.html

It uses a javascript hash function to send the password.

--
--
~kaeli~
If a parsley farmer is sued, can they garnish his wages?
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 20 '05 #10

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

Similar topics

12
18015
by: chrism | last post by:
Hello, I have a pop-up window that I would like to appear in front of the browser home page when a user opens IE. Problem is, I'd like it to never appear again if the user navigates back to the home page during their time using the browser. However, if the user closes the browser, then reopens, the pop-up should appear again. (you may have guessed that this will be used for public access pc's.) I want to try as best I can to catch...
3
5976
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 the value of that session cookie in response to a button click in a form, without resubmitting the page. For some reason, the following doesn't seem to work:
7
7215
by: What-a-Tool | last post by:
How does the expire date work setting it server side with asp. I know with javascript setting it client side it will be set to the clients local time, and therefore expire when the clients local time reaches the set expire-time. But if it is an expire time set on my server in California, and the cookie is put on a computer that is running on London Time, and the expire time is set at the server as 20 minutes from now, the London computer...
2
3437
by: junOnline | last post by:
Hi, I am developing an asp.net 2.0 application using visual studio 2005 on my computer and I am getting very inconsistent results when I test on my computer versus from other computers. The symptom of the problem is that the web server does not receive cookie information from the browser after I have properly logged in to the web server. Without this information, my session state keeps on getting lost and the authentication logic sends...
23
3215
by: Phil Powell | last post by:
// OBTAINED FROM http://www.javascripter.net/faq/settinga.htm // NOTE THAT IF YOU SET days TO -1 THE COOKIE WILL BE SET TO YESTERDAY AND THUS EXPIRE function setCookie(name, value, days, docObj) { var today = new Date(); var expire = new Date(); if (days == null || isNaN(days) || days == 0) days = 1; if (days >= 1 || days < 0) expire.setTime(today.getTime() + 3600000 * 24 * days);
2
2711
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"/> </forms> </authentication> </system.web>
2
6252
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 browse to a page on a server and if the content of the page is the following: <html> <head><script> alert(document.cookie);
29
3012
by: Jerim79 | last post by:
I did try to find the answer to this before posting, so this isn't a knee jerk reaction. What I am trying to accomplish is to have a script that opens a cookie, reads a value, and then use a switch/case to take action based on that value in the cookie. I want to set the cookie manually, so I don't need setcookie(). I see that in PHP it stores the cookie in memory. Is there a way to have PHP just read a cookie from the desktop machine?...
3
2601
by: WayneH | last post by:
Hi - I'm trying to use javascript to determine if a user's browser has cookies enabled or not. To test: copy this code into a file with a 'html' extension, and load it into your IE browser directly, through a local web server and through a remote web server. By turning cookies on/off in your browser, running the file, then clicking the 'test1' or 'test2' buttons, the displayed text should accurately inform you if your cookies are On or...
16
2982
by: Stevo | last post by:
I'm guessing this is a laughably obvious answer to many here, but it's not to me (and I don't have a server or any knowledge of PHP to be able to try it). It's not strictly a PHP question, but something that PHP guys would know the answer to. I can't think of a more appropriate forum to try. I've heard the ASP and JSP guys aren't as friendly ;-) Let's say we have a HTML page from domain example.com, and that HTML page makes a request to...
0
9474
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10143
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10076
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8964
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7486
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6729
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5375
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5507
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3633
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.