Re: [PHP] Logged Out of Seesion, Then use back button

2003-09-23 Thread Didier McGillis
http://www.php.net/manual/en/function.header.php

?php
// Date in the past
header(Expires: Mon, 26 Jul 1997 05:00:00 GMT);
// always modified
header(Last-Modified:  . gmdate(D, d M Y H:i:s) .  GMT);
// HTTP/1.1
header(Cache-Control: no-store, no-cache, must-revalidate);
header(Cache-Control: post-check=0, pre-check=0, false);
// HTTP/1.0
header(Pragma: no-cache);
?


From: Roger Spears [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: [PHP] Logged Out of Seesion, Then use back button
Date: Tue, 23 Sep 2003 11:51:40 -0400
Hello,

I've googled to try to find an answer to this.  I've also checked the 
php.net site.  Perhaps I'm not using the correct search parameters.  The 
only suggestion I've found is the following code:

?php
header('Cache-Control: no-cache');
header('Pragma: no-cache');
?
But this doesn't seem to solve my problems.

My problem/question is as follows.

I have an email script that works in the following steps:

1) Login (if success then FROM and a personal email signature are 
properly populated)

2) Choose specifics for the email (this populates the TO variable and the 
other BODY variables)

3) Then click on preview (this creates the email with all the current 
variables, on the screen for viewing)

4) Then send the email

5) Prompted to create another or logout (if create another, then some 
session variables are unset) (if logout then session is destroyed)

Everything works as intended.

One user, however, has created a glitch.  He/she logged out and later 
returned to their still opened browser and used the back button to return 
to step 2 in the process.  Every email they created after using the back 
button has the following problems:
1) The reply to address and the from address are both default server 
address's and not the users personal email address.
2) Their is no personal signature.

Here's my questions
1) How can I prevent the use of the browser back button after someone 
logs out?
2) If, after a user has attained step 3, they use their back button to 
change a variables value in step 2, the new value is never saved by the 
session and their original entry is used in the email.  How can I adjust 
for people using their back buttons during the individual steps of the 
script?
3) Should the header calls appear before the session_start or after?

Thanks in advance,
Roger
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
_
MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*.  
http://join.msn.com/?page=features/virus

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Logged Out of Seesion, Then use back button

2003-09-23 Thread Roger Spears
Sorry Didier, your suggestion did not solve the problem.  I appreciate 
the information though!

I'm still having the back button problem in the middle of using the 
script.

Thanks,
Roger
Didier McGillis wrote:

http://www.php.net/manual/en/function.header.php

?php
// Date in the past
header(Expires: Mon, 26 Jul 1997 05:00:00 GMT);
// always modified
header(Last-Modified:  . gmdate(D, d M Y H:i:s) .  GMT);
// HTTP/1.1
header(Cache-Control: no-store, no-cache, must-revalidate);
header(Cache-Control: post-check=0, pre-check=0, false);
// HTTP/1.0
header(Pragma: no-cache);
?


From: Roger Spears [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: [PHP] Logged Out of Seesion, Then use back button
Date: Tue, 23 Sep 2003 11:51:40 -0400
Hello,

I've googled to try to find an answer to this.  I've also checked the 
php.net site.  Perhaps I'm not using the correct search parameters.  
The only suggestion I've found is the following code:

?php
header('Cache-Control: no-cache');
header('Pragma: no-cache');
?
But this doesn't seem to solve my problems.

My problem/question is as follows.

I have an email script that works in the following steps:

1) Login (if success then FROM and a personal email signature are 
properly populated)

2) Choose specifics for the email (this populates the TO variable 
and the other BODY variables)

3) Then click on preview (this creates the email with all the current 
variables, on the screen for viewing)

4) Then send the email

5) Prompted to create another or logout (if create another, then some 
session variables are unset) (if logout then session is destroyed)

Everything works as intended.

One user, however, has created a glitch.  He/she logged out and later 
returned to their still opened browser and used the back button to 
return to step 2 in the process.  Every email they created after 
using the back button has the following problems:
1) The reply to address and the from address are both default server 
address's and not the users personal email address.
2) Their is no personal signature.

Here's my questions
1) How can I prevent the use of the browser back button after 
someone logs out?
2) If, after a user has attained step 3, they use their back button 
to change a variables value in step 2, the new value is never saved 
by the session and their original entry is used in the email.  How 
can I adjust for people using their back buttons during the 
individual steps of the script?
3) Should the header calls appear before the session_start or after?

Thanks in advance,
Roger
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
_
MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*.  
http://join.msn.com/?page=features/virus

--
Roger Spears
Technology Project Coordinator
College of Arts and Sciences
Bowling Green State University
205 Administration Bldg.
Bowling Green, OH 43403
419-372-2015
419-372-8548 fax
The best accelerator available for a Mac is one that causes it to go at 9.81 m/s2.
(The rate at which objects fall to earth)
It would be just like programmers to shorten 'the year 2000 problem' to 'Y2K'... exactly 
the kind of thinking that created this situation in the first place.
- Steven C. Meyer
The significant problems we face cannot be solved at the same level of thinking we were at 
when we created them.
- Albert Einstein
If a cluttered desk is a sign of a cluttered mind, of what then, is an empty desk?
- Albert Einstein
It is well to remember that the entire universe, with one trifling exception, is composed 
of others.
- John Andrew Holmes
The only thing more dangerous than a hardware guy with a code patch is a programmer with a soldering iron.

3 Biggest Computer Room Lies:
1) As long as you remember to 'SAVE' your input, you'll never lose any files.
2) We run the stuff through as fast as it comes in the door.
3) The new machines are in order.
Murphy's Laws of Computing
--
  1. When computing, whatever happens, behave as though you meant it to happen.
  2. When you get to the point where you really understand your computer, it's 
probably obsolete.
  3. The first place to look for information is in the section of the manual where you 
least expect to find it.
  4. When the going gets tough, upgrade.
  5. For every action, there is an equal and opposite malfunction.
  6. To err is human... to blame your computer for your mistakes is even more human, 
it is downright natural.
  7. He who laughs last probably made a back-up.
  8. If at first you do not succeed, blame your computer.
  9. A complex system that does not work is invariably found to have evolved from a 
simpler system that worked just fine.
 10. The number one cause of computer problems is computer solutions.
 11. A computer program will always do what you tell it to do, but rarely what you 
want to do.


--
PHP General Mailing List (http://www.php.net/)
To 

RE: [PHP] Logged Out of Seesion, Then use back button

2003-09-23 Thread Jay Blanchard
[snip]
1) How can I prevent the use of the browser back button after someone 
logs out?
[/snip]

Set a cookie on login, unset the cookie on logout. Check for cookie, if
it doesn't exist display login mechanism.

[snip]
2) If, after a user has attained step 3, they use their back button to 
change a variables value in step 2, the new value is never saved by the 
session and their original entry is used in the email.  How can I adjust

for people using their back buttons during the individual steps of the

script?
[/snip]

You would have to disable the back button.

[snip]
3) Should the header calls appear before the session_start or after?
[/snip]

before

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Logged Out of Seesion, Then use back button

2003-09-23 Thread CPT John W. Holmes
From: Roger Spears [EMAIL PROTECTED]

 1) How can I prevent the use of the browser back button after someone
 logs out?

You don't. You never prevent the use of the back button. When someone logs
in, then a session should be started with some content, like you've already
mentioned. So, thoughout the process, you make sure that session is still
there and complete with the appropriate content. When the user logs out, you
get rid of the session and that content. Now, when they hit back, they'll
still have an empty session, so your script should require them to log in
again to get a correct session.

 2) If, after a user has attained step 3, they use their back button to
 change a variables value in step 2, the new value is never saved by the
 session and their original entry is used in the email.  How can I adjust
 for people using their back buttons during the individual steps of the
 script?

Again, you can't (shouldn't) stop people from using the back button. There
is something wrong with your logic if the values are not saved when step 2
is submitted. If shouldn't matter if step 3 has already been completed or
not.

 3) Should the header calls appear before the session_start or after?

Doesn't matter. Just send them before any output.

---John Holmes...

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php