473,231 Members | 1,690 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,231 software developers and data experts.

Possible Cookie Usage?

In a Web site I'm building, I want to provide an ability to set a
"flag" message that users can see when they log on. Specifically, I
want the "flag" to show when the (snail) mail for our building has been
delivered, so people can come to the mailboxes to pick up their incoming
mail.
The problem is that I want to have a staff person "set the flag" in
some way. This person won't be technically savvy, nor would I want to
give them security permissions that their mistake could damage the site.
I also can't do the flag setting myself, as I won't always be available
at the time it's needed.
An initial thought I had was to use cookies: one that the staff
person could set and that my Web code could interpret and display. The
latter part seems simple enough, but I don't know how (or if) another
user could set the flag (in a cookie or file) and have the communication
work. That is, have the Web code access a cookie (or simple file) on a
specific user's (the staff person's) computer. In such a scenario, the
staff person would run a program or access a Web interface that would
write to a file (a cookie?) and the building's web site code would read
that information and report on it.
If this is possible, I don't quite know how to implement it. I
assume it's a simple JavaScript cookie reading activity, but I don't
know how to get that staff person's activity to write the file and where
it'd be stored. Any thoughts? TIA
Jun 27 '08 #1
5 1010
In comp.lang.javascript message <MP************************@news.cox.net
>, Mon, 28 Apr 2008 10:06:05, Mike Copeland <mr*****@cox.netposted:
In a Web site I'm building, I want to provide an ability to set a
"flag" message that users can see when they log on. Specifically, I
want the "flag" to show when the (snail) mail for our building has been
delivered, so people can come to the mailboxes to pick up their incoming
mail.
The problem is that I want to have a staff person "set the flag" in
some way. This person won't be technically savvy, nor would I want to
give them security permissions that their mistake could damage the site.
I also can't do the flag setting myself, as I won't always be available
at the time it's needed.
You could maybe use a VBScript or JavaScript program running on their
machine under WSH, with buttons for "Mail has come" and "No it hasn't",
each of which invokes an FTP to upload an Include file which contains
either
var MailHere = true
or var MailHere = false
so that when they load a page it is customised by that.

Even better, you could give the staff person a compiled program that had
the FTP built in (I suppose you're defending against incompetence or
meddling, and not against skilled malice).

For a single daily delivery, code can clear the state at midnight; for
multiple deliveries it might be better to send the day's set of actual
delivery times.

--
(c) John Stockton, nr London, UK. ?@merlyn.demon.co.uk Turnpike v6.05 MIME.
Web <URL:http://www.merlyn.demon.co.uk/- FAQish topics, acronyms, & links.
Proper <= 4-line sig. separator as above, a line exactly "-- " (SonOfRFC1036)
Do not Mail News to me. Before a reply, quote with ">" or "" (SonOfRFC1036)
Jun 27 '08 #2
Mike Copeland wrote:
* *In a Web site I'm building, I want to provide an ability to set a
"flag" message that users can see when they log on. *Specifically, I
want the "flag" to show when the (snail) mail for our building has been
delivered, so people can come to the mailboxes to pick up their incoming
mail.
* *The problem is that I want to have a staff person "set the flag" in
some way. *This person won't be technically savvy, nor would I want to
give them security permissions that their mistake could damage the site. *
I also can't do the flag setting myself, as I won't always be available
at the time it's needed.
* *An initial thought I had was to use cookies: one that the staff
person could set and that my Web code could interpret and display. *The
latter part seems simple enough, but I don't know how (or if) another
user could set the flag (in a cookie or file) and have the communication
work. *That is, have the Web code access a cookie (or simple file) on a
specific user's (the staff person's) computer. *In such a scenario, the
staff person would run a program or access a Web interface that would
write to a file (a cookie?) and the building's web site code would read
that information and report on it.
* *If this is possible, I don't quite know how to implement it. *I
assume it's a simple JavaScript cookie reading activity, but I don't
know how to get that staff person's activity to write the file and where
it'd be stored. *Any thoughts? *TIA
I'm not sure how this could be solved with cookies.

Admin page:

Set flag: <select name="flag" size="1">
<option value="true">true</option>
<option value="false">false</option>
</select>
<input type="submit">

Then use your favourite server-side langue to receive the form data
and store it in a file.

User pages could then perform an XMLHttpRequest to that file. If it
holds 'yes', then show the mail-icon in question.

Hope this helps,

--
Bart
Jun 27 '08 #3
In article <MP************************@news.cox.net>,
mr*****@cox.net (Mike Copeland) wrote:
If this is possible, I don't quite know how to implement it. I
assume it's a simple JavaScript cookie reading activity, but I don't
know how to get that staff person's activity to write the file and where
it'd be stored. Any thoughts? TIA
If I read the problem right, the easiest solution is a simple timestamp.
Give the person in the mail room access to a trivial CGI (could be just
touching a file) that refreshes a master value, and that value is
supplied with the web interface. You can certainly add a JavaScript
cookie to compare the supplied value with the last stored value and add
some fancy notification if there's a change. It is slightly more tricky
if you want to give notification for individual mailboxes, but the basic
approach is the same.

--
My personal UDP list: 127.0.0.1, 4ax.com, buzzardnews.com, googlegroups.com,
heapnode.com, localhost, ntli.net, teranews.com, vif.com, x-privat.org
Jun 27 '08 #4
If this is possible, I don't quite know how to implement it. I
assume it's a simple JavaScript cookie reading activity, but I don't
know how to get that staff person's activity to write the file and where
it'd be stored. Any thoughts? TIA

If I read the problem right, the easiest solution is a simple timestamp.
Give the person in the mail room access to a trivial CGI (could be just
touching a file) that refreshes a master value, and that value is
supplied with the web interface. You can certainly add a JavaScript
cookie to compare the supplied value with the last stored value and add
some fancy notification if there's a change. It is slightly more tricky
if you want to give notification for individual mailboxes, but the basic
approach is the same.
Yes, that could do the job. However, how does the timestamp/flag get
"transmitted" to the Web site interface? That is, I could write a small
application that "touches" a file, but where does such a file reside to
have it accessible by my HTML/Javascript/CSS code that resides on the
server host? How would my code know where that file is, and how does it
interrogate it to find its timestamp?
No, I don't need to deal with specific mailboxes, because the mail is
delivered to the building once/day...but the times vary so much I am
trying to implement this interface to avoid the many calls to the Front
Desk that now occur. It's the Front Desk person who knows when the mail
has arrived and can "set the flag".
Jun 27 '08 #5
In article <MP************************@news.cox.net>,
mr*****@cox.net (Mike Copeland) wrote:
If this is possible, I don't quite know how to implement it. I
assume it's a simple JavaScript cookie reading activity, but I don't
know how to get that staff person's activity to write the file and where
it'd be stored. Any thoughts? TIA
If I read the problem right, the easiest solution is a simple timestamp.
Give the person in the mail room access to a trivial CGI (could be just
touching a file) that refreshes a master value, and that value is
supplied with the web interface. You can certainly add a JavaScript
cookie to compare the supplied value with the last stored value and add
some fancy notification if there's a change. It is slightly more tricky
if you want to give notification for individual mailboxes, but the basic
approach is the same.
Yes, that could do the job. However, how does the timestamp/flag get
"transmitted" to the Web site interface? That is, I could write a small
application that "touches" a file, but where does such a file reside to
have it accessible by my HTML/Javascript/CSS code that resides on the
server host? How would my code know where that file is, and how does it
interrogate it to find its timestamp?
I have no way of knowing how your corporate intranet functions. You'd
use PHP or Perl or Ruby or whatever else is already in place to handle
the server side processing. If you're not the person in control of
that, you need to talk to the person who is. That is beyond the scope
of JavaScript, though. All that JavaScript can accomplish is to put a
more friendly interface on the web page (or possibly a widget/gadget)
that relays that information to the user.

--
My personal UDP list: 127.0.0.1, 4ax.com, buzzardnews.com, googlegroups.com,
heapnode.com, localhost, ntli.net, teranews.com, vif.com, x-privat.org
Jun 27 '08 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
by: Phil Powell | last post by:
Fourth attempt.. it fails now in login, I check by printing $_COOKIE and there is no value there! Guys, what on earth do I do about this???? Here is the code that sets the cookie: if...
2
by: Christophe Lance | last post by:
Hello, I use PHP session cookie to store an id number. I know how to set a cookie expiration date using the setcookie function, but how to set an expiration date when the cookie is created by...
0
by: obhayes | last post by:
Hi All, Im using classic ASP (3.0) and I have a web farm with 2 webservers (webserver A and webserver B, both windows server 2003). I do not want to store any client specific information on the...
1
by: brad | last post by:
Hi, Im using classic ASP (3.0) and I have a web farm with 2 webservers (webserver A and webserver B, both windows server 2003). I do not want to store any client specific information on the...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.