Solved

Cookie usage for web pages on my hard disk

Posted on 2013-01-31
9
176 Views
Last Modified: 2013-01-31
I have some HTML pages that are stored locally on my laptop's hard disk.  These pages are for product demonstration purposes, so there's no need for a webserver.

These web pages work correctly when hosted on a webserver with regards to saving cookies for pages.

When I view the pages from my local hard disk (no webserver), cookies are not stored or read in.  As a result, the pages do not have the same interaction as they would when hosted.

Is there some setting in IE or Chrome that would permit saving & reading cookies for locally stored web pages?
0
Comment
Question by:ttitus
9 Comments
 
LVL 52

Expert Comment

by:Scott Fell, EE MVE
ID: 38841571
It should work if you use localhost rather then just opening it in the browser from your file system.
0
 

Author Comment

by:ttitus
ID: 38841616
I don't have a webserver on my laptop, thus no localhost.
0
 
LVL 83

Accepted Solution

by:
Dave Baldwin earned 500 total points
ID: 38841677
Then cookies will not work properly because they have no 'domain' that they are served from.  There are no settings that will change that.  Except installing a web server.  If they are all just HTML pages, the requirements are minimal.  What OS on your laptop?
0
 
LVL 29

Expert Comment

by:Paul Jackson
ID: 38841689
The use of cookies is only possible when web pages are served by a web server.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:ttitus
ID: 38841693
I have Win7 on my laptop.

I'm currently reading that there is a command-line option in Chrome that might solve the problem of saving cookies for local pages, but I haven't played with that yet.

I would like to use either Chrome (preference), or IE for my demonstrations, so if you know of a method that would work for either browser, that would fix my problem.

If there is no elegant fix, then I'll take 2 days and code a really lightweight webserver that will only support pages requested from localhost so it will work/act more like it should.
0
 

Author Comment

by:ttitus
ID: 38841699
Here's the Chrome switch:

By default, cookies are not allowed on file://. They are needed in for
testing, for example page cycler and layout tests. See bug 1157243.
--enable-file-cookies

This was from http://www.ericdlarson.com/misc/chrome_command_line_flags.html

I haven't tested yet, but am about to try.
0
 

Author Comment

by:ttitus
ID: 38842127
Sadly, it didn't work.  Google should list that option as deprecated due to security issues.
0
 

Author Closing Comment

by:ttitus
ID: 38842129
Good discussion.
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 38842147
Thanks for the points.  As far as I can tell, almost nothing ever gets deleted on the internet.  You are always stuck with making sure that anything you find is still current.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
This article discusses how to create an extensible mechanism for linked drop downs.
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now