By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,238 Members | 1,661 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,238 IT Pros & Developers. It's quick & easy.

Retaining private variables

P: n/a
Hi,

The problem I'm having is that I need to retain Javascript variables
across multiple page refreshes.

The obvious solution is cookies. However AFAIK, these are always sent
to the server in plaintext. This is something I absolutely *don't* want
to happen- I want to store private variables (specifically, a password)
for access by the client only.

One idea I had was to keep a small login window permanently open, store
the values there, and access them through its window object.
Unfortunately, this requires the retention of the login window object's
reference value..... which gets lost when the main window is refreshed.
Although I can reuse the small window itself via its name, this does
*not* provide access the old window object (and hence the variables I
want).

Note that I can't rely on having HTTPS available, unfortunately. Any
ideas? TIA :)

- tr*****@oink.co.uk

Jun 27 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
tr*****@oink.co.uk wrote:
Hi,

The problem I'm having is that I need to retain Javascript variables
across multiple page refreshes.

The obvious solution is cookies. However AFAIK, these are always sent
to the server in plaintext. This is something I absolutely *don't* want
to happen- I want to store private variables (specifically, a password)
for access by the client only.

One idea I had was to keep a small login window permanently open, store
the values there, and access them through its window object.
Unfortunately, this requires the retention of the login window object's
reference value..... which gets lost when the main window is refreshed.
Although I can reuse the small window itself via its name, this does
*not* provide access the old window object (and hence the variables I
want).

Note that I can't rely on having HTTPS available, unfortunately. Any
ideas? TIA :)
What about a hidden frame?

Regards,
Erwin Moller

- tr*****@oink.co.uk


Jun 27 '06 #2

P: n/a
Erwin Moller wrote:
What about a hidden frame?


Yeah... I'd considered that a while back. The reason I dropped it is
that the way the app was programmed (badly) is such that doing this
will probably require rearranging a lot of stuff and testing again.
Basically, I started the app, learned a lot (about lots of different
technologies) whilst I was doing it and as a result the design is
over-complicated and rather "fixed" now. I should have started from
scratch again with a cleaner design at an early stage; it would have
been a lot quicker in the long term.

Bad mistake, but it's pretty much complete now :-(

tr*****@oink.co.uk

Jun 27 '06 #3

P: n/a
Erwin Moller wrote:
What about a hidden frame?


Just figured out another problem; although there will generally be a
"main" window, some of the editors, etc. will be popups. Although it's
possible to transfer the value to the newly-opened window, this is a
bit convuluted. OTOH, now that I've thought about your suggestion, it's
given me another idea that might (or might not) work... so thanks
anyway :)

tr*****@oink.co.uk

Jun 27 '06 #4

P: n/a
tr*****@oink.co.uk wrote:
Erwin Moller wrote:
What about a hidden frame?
Just figured out another problem; although there will generally be a
"main" window, some of the editors, etc. will be popups. Although it's
possible to transfer the value to the newly-opened window, this is a
bit convuluted. OTOH, now that I've thought about your suggestion, it's
given me another idea that might (or might not) work... so thanks
anyway :)


Good. :-)

Best of luck.

Regards,
Erwin Moller

tr*****@oink.co.uk


Jun 28 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.