Discussion Locked

Client/Server Cookies Question

0 helpful
6 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Any way a server can set a cookie that the client can read from an Offline version of the site on HD?

We have a website designed to be accessed both ONline and OFFline from a Hard Disk Install on a laptop.

MUCH functionality added by storing sales reps Name, Address, etc. in Cookie to "Pre-fill" in a lot of forms.

User fills out Master form OFFline and cookie saved.
Next time they go ONline, this is sent to the server and the server sends back as a cookie, no problem for ONline use.
PROBLEM: If user FIRST fills out form ONline the server can read it's own cookie, but they must fill out form while OFFline again so the cookie can be read OFFline.
All browsers 4.0+ but some Macs/NetScrape so an OCX not a solution.

Elegant solutions appreciated, kludges greatfully accepted.

Egg

6 replies

by joakim.kosmo

No. This is infact a feature.
Your trouble is that a cookie can just be read from the same server that created it. The users computer is counted as a sepperate server. This is a security feature. You might be able to solve this by creating 2 cookies, but you will need to create a lot of logic to be sure that they are syncronized. You will probably also run into trouble exchanging data between frames connected to local machine and frames connected to server.
Probably the only sollution will be to always work offline, and only use server to recive the data sent to it.

by original eggman

Yes, I know the security 'features' of the cookie spec. I was attempting to find out if there was some kind of 'generic' cookie that I could set that the client could read. Since the client would be reading it from itself, I had hoped there would besome kludge.

I DID, however (until they fix it) figure out how to do it! I'm going to install a text file in the client root containing the path to the installed site. The server can read this and get it's path info from it. THEN call an HTML file in the installation directory, pass the data to it in the location.search, and THAT file will set the local cookie. (Whew!)

THANKS FOR THE ATTEMPT!

by bill

Why not use a local text file instead of the 'cookie' when offline? You could store the info in the local file and when working offline read that file in place of the cookie?

Then, when the user is online again, you could have a synch process (user initiated) that generates the various forms, as indicated by the text file's contents, and then sends the updates to the server, using the 'cookie' process as needed, as if the forms had just been generated online.

It may be kludgy... but it might also work.

by original eggman

ALMOST - the server can't write to the text file, but my installation program can. I'll put the path to the installation dir. there, let the server read it and THEN the server can pass control to an HTML file on the client, sending the needed info in the location.search. THAT file can extract this and build a cookie referencing the proper path.

That is, of course, until someone considers this a security hole and 'fixes' it.

Thanks

Egg

This discussion is closed to new replies.