Using Cookies with Local files

M

mfhiatt

I'm using a cookie on a site that works fine.

BUT

When I run the files from my local hard drive, it doesn't work.

Can you use cookies with files that reside locally? If not, is there a
solution that would work with both local files and files that reside on
a server?

Thanks

Mike

please respond to:

(e-mail address removed)
 
L

Leonard Blaisdell

Can you use cookies with files that reside locally? If not, is there a
solution that would work with both local files and files that reside on
a server?

You need to be running a server on your machine. It's not particularly
difficult.
please respond to:
(e-mail address removed)

Not today :-(

leo
 
A

Andy Dingley

I'm using a cookie on a site that works fine.

When I run the files from my local hard drive, it doesn't work.

Cookies are a HTTP thing, not a HTML thing. You need a HTTP server, not
just a local filesystem.

Best way for a HTTP server is to find a tired old PC and resurrect it
running a minimal Unix and Apache. Try Ubuntu, or the ready-packaged
"minimal Unix and Apache" bundles. You'll not regret this as a web
developer, it makes deployment out to the live servers much less
troublesome. Many things are now getting more and more sensitive to
HTTP content-type etc. and although filesystems work for the basics,
they're never exactly the same environment.

If you're on a laptop and mobile, then you're probably running Windows
and you can still run a web server on there. IIS / PWS for Windows
native, or even Apache again.
 
A

Alan J. Flavell

You need a HTTP server, not just a local filesystem.

There are indeed many advantages in running a local web server on
one's development platform.
Best way for a HTTP server is to find a tired old PC and resurrect
it running a minimal Unix and Apache.

I would dare to suggest that the best way is to run Apache on whatever
one's development platform happens to be.

If it's OS X, like on my colleague's laptop, then that's where Apache
gets run.

In the event that one was running MS Win (XP, 2K etc.) then Win Apache
2.0 is a viable solution (whereas Win Apache 1.3 had less to recommend
it). There are some significant differences on the Win platform, but
if one steers clear of them (case sensitivity in URLs, differences in
XBitHack behaviour...) then whatever is developed on the Win platform
can port rather seamlessly to the real server.
Try Ubuntu, or the ready-packaged "minimal Unix and Apache" bundles.

I'm *not* recommending specifically choosing MS Win for this purpose,
but *if* one is using MS Win already, then that's where I would
recommend running the development server. You probably want to set it
so that it only accepts calls from localhost (or from a very tightly
controlled range of addresses).
You'll not regret this as a web developer, it makes deployment out
to the live servers much less troublesome.
Absolutely.

If you're on a laptop and mobile, then you're probably running
Windows and you can still run a web server on there. IIS / PWS for
Windows native, or even Apache again.

If the ultimate production server is going to be Apache-family, then I
can't see the slightest attraction in running IIS. It would need a
different skillset, quite apart from imponderables in the security
area.

hth
 
A

Andy Dingley

Alan said:
There are indeed many advantages in running a local web server on
one's development platform.

No-one ever got sacked for learninmg Unix.

Old Apache under Windows was certainly an evil thing. I'm glad to have
it confirmed that later ones are better -- I've not much experience of
it myself.
 
M

mfhiatt

But if I send out a site on a CD, what can I use in lieu of cookies for
the end user? Flash Shared Obects? Anything else?
 
?

=?iso-8859-1?Q?Kim_Andr=E9_Aker=F8?=

I'm using a cookie on a site that works fine.

BUT

When I run the files from my local hard drive, it doesn't work.

Can you use cookies with files that reside locally? If not, is there a
solution that would work with both local files and files that reside
on a server?

Nothing that's 100% foolproof, though. The closest thing you get, is by
using the JavaScript property document.cookie.
http://www.w3schools.com/js/js_cookies.asp

Keep in mind that this method won't work if you have JavaScript (or
client-side scripting in general) disabled or unavailable in your
browser.
Thanks

Mike

No problem.
please respond to:

(e-mail address removed)

You ask a question on Usenet, we respond to you on Usenet.
 
S

Steven Saunderson

Can you use cookies with files that reside locally? If not, is there a
solution that would work with both local files and files that reside on
a server?

It's possible if you have Javascript enabled. I have some pages that
use a cookie to remember which checkboxes are selected.

Is this the sort of capability you require ?
 
A

Andy Dingley

But if I send out a site on a CD, what can I use in lieu of cookies for
the end user? Flash Shared Obects? Anything else?

Don't use cookies.

I can't think of many reasons why you'd really need them, for a
competently authored site, delivered on CD. There are a _few_ reasons,
generally based on making persistent user choices or recording state.
Most of the "traditional" cookie reasons though only make sense with a
server-based process, or they're somewhat dubious anyway (such as
storing font size choices in a cookie).
 
N

Nick Theodorakis

But if I send out a site on a CD, what can I use in lieu of cookies for
the end user? Flash Shared Obects? Anything else?

I'm at a bit of a loss as to why a local website needs to set cookies.
Can you elaborate?

Nick
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top