473,395 Members | 1,774 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,395 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 1019
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.