Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Cookie usage for web pages on my hard disk

Posted on 2013-01-31
9
Medium Priority
?
181 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:Tim Titus
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
9 Comments
 
LVL 53

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:Tim Titus
ID: 38841616
I don't have a webserver on my laptop, thus no localhost.
0
 
LVL 84

Accepted Solution

by:
Dave Baldwin earned 2000 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
The top UI technologies you need to be aware of

An important part of the job as a front-end developer is to stay up to date and in contact with new tools, trends and workflows. That’s why you cannot miss this upcoming webinar to explore the latest trends in UI technologies!

 
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
 

Author Comment

by:Tim Titus
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:Tim Titus
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:Tim Titus
ID: 38842127
Sadly, it didn't work.  Google should list that option as deprecated due to security issues.
0
 

Author Closing Comment

by:Tim Titus
ID: 38842129
Good discussion.
0
 
LVL 84

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

Enroll in September's Course of the Month

This month’s featured course covers 16 hours of training in installation, management, and deployment of VMware vSphere virtualization environments. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
A while back, I ran into a situation where I was trying to use the calculated columns feature in SharePoint 2013 to do some simple math using values in two lists. Between certain data types not being accessible, and also with trying to make a one to…
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…

715 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