![]() |
|
|
|||||||
![]() |
HTML - Using Cookies with Local files |
|
|
Thread Tools | Search this Thread |
|
|
#1 |
|
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: mfhiatt@netins.net |
|
|
|
|
#2 |
|
Posts: n/a
|
In article < .com>,
"" <> wrote: > 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: > Not today leo -- <http://web0.greatbasin.net/~leo/> |
|
|
|
#3 |
|
Posts: n/a
|
wrote: > 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. |
|
|
|
#4 |
|
Posts: n/a
|
On Fri, 16 Jun 2006, Andy Dingley <> wrote:
> 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 |
|
|
|
#5 |
|
Posts: n/a
|
Alan J. Flavell wrote:
> On Fri, 16 Jun 2006, Andy Dingley <> wrote: > > > 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. 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. |
|
|
|
#6 |
|
Posts: n/a
|
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? Andy Dingley <> wrote: > Alan J. Flavell wrote: > > On Fri, 16 Jun 2006, Andy Dingley <> wrote: > > > > > 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. > > 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. |
|
|
|
#7 |
|
Posts: n/a
|
wrote:
> 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: > > You ask a question on Usenet, we respond to you on Usenet. -- Kim André Akerř - (remove NOSPAM to contact me directly) |
|
|
|
#8 |
|
Posts: n/a
|
On 15 Jun 2006 11:04:29 -0700, "" <>
wrote: > 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 ? -- Steven |
|
|
|
#9 |
|
Posts: n/a
|
wrote: > 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). |
|
|
|
#10 |
|
Posts: n/a
|
wrote:
> 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 -- Nick Theodorakis contact form: http://theodorakis.net/contact.html |
|