Discussion:
Webpage has expired
hadi
2014-06-08 21:44:50 UTC
Permalink
Hi,

I'm facing trouble here when user click back button in the browser after
login it give him (Webpage has expired).

Can someone help here regard this matter.
Thanks.

My code

Page2.

<html>
<body>
<form action="test3.php" method="post">
Username: <br><input type="text" name="username"></br>
<input type="submit" name = 'submit1' value= 'Login'>
</form>
</body>
</html>

Page3.

<?php
session_start();
?>

<html>
<body>

<?php
$username = $_POST['username'];
$_SESSION['username']= $_POST['username'];
echo "<br> Hi $username.</br>";
?>

<form action="test4.php" method="post">
<input type="submit" name = 'submit' value= 'click me'>
</form>

</body>
</html>

Page4.

<?php
session_start();
$username = $_SESSION['username'];
echo "<br> Hi $username.</br>";
?>

Php.ini

Session Support enabled
Registered save handlers files user sqlite
Registered serializer handlers php php_binary

session.auto_start Off Off
session.bug_compat_42 Off Off
session.bug_compat_warn Off Off
session.cache_expire 180 180
session.cache_limiter nocache nocache
session.cookie_domain no value no value
session.cookie_httponly Off Off
session.cookie_lifetime 0 0
session.cookie_path /tmp /tmp
session.cookie_secure Off Off
session.entropy_file no value no value
session.entropy_length 0 0
session.gc_divisor 1000 1000
session.gc_maxlifetime 1440 1440
session.gc_probability 1 1
session.hash_bits_per_character 5 5
session.hash_function 0 0
session.name PHPSESSID PHPSESSID
session.referer_check no value no value
session.save_handler files files
session.save_path /tmp /tmp
session.serialize_handler php php
session.use_cookies On On
session.use_only_cookies On On
session.use_trans_sid 0 0

Regards
-Hadi
Ashley Sheridan
2014-06-08 21:47:42 UTC
Permalink
Post by hadi
Hi,
I'm facing trouble here when user click back button in the browser after
login it give him (Webpage has expired).
Can someone help here regard this matter.
Thanks.
My code
Page2.
<html>
<body>
<form action="test3.php" method="post">
Username: <br><input type="text" name="username"></br>
<input type="submit" name = 'submit1' value= 'Login'>
</form>
</body>
</html>
Page3.
<?php
session_start();
?>
<html>
<body>
<?php
$username = $_POST['username'];
$_SESSION['username']= $_POST['username'];
echo "<br> Hi $username.</br>";
?>
<form action="test4.php" method="post">
<input type="submit" name = 'submit' value= 'click me'>
</form>
</body>
</html>
Page4.
<?php
session_start();
$username = $_SESSION['username'];
echo "<br> Hi $username.</br>";
?>
Php.ini
Session Support enabled
Registered save handlers files user sqlite
Registered serializer handlers php php_binary
session.auto_start Off Off
session.bug_compat_42 Off Off
session.bug_compat_warn Off Off
session.cache_expire 180 180
session.cache_limiter nocache nocache
session.cookie_domain no value no value
session.cookie_httponly Off Off
session.cookie_lifetime 0 0
session.cookie_path /tmp /tmp
session.cookie_secure Off Off
session.entropy_file no value no value
session.entropy_length 0 0
session.gc_divisor 1000 1000
session.gc_maxlifetime 1440 1440
session.gc_probability 1 1
session.hash_bits_per_character 5 5
session.hash_function 0 0
session.name PHPSESSID PHPSESSID
session.referer_check no value no value
session.save_handler files files
session.save_path /tmp /tmp
session.serialize_handler php php
session.use_cookies On On
session.use_only_cookies On On
session.use_trans_sid 0 0
Regards
-Hadi
As I said, your form is sent as POST, so this is a normal browser response to using the back button.
Thanks,
Ash
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
hadi
2014-06-08 22:30:29 UTC
Permalink
Ash,
Post by Ashley Sheridan
As I said, your form is sent as POST, so this is a normal browser response
to
using the back button.
How to get rid of it. any idea ?
Post by Ashley Sheridan
-----Original Message-----
Sent: Monday, June 09, 2014 12:48 AM
Subject: Re: [PHP] Webpage has expired
Post by hadi
Hi,
I'm facing trouble here when user click back button in the browser
after login it give him (Webpage has expired).
Can someone help here regard this matter.
Thanks.
My code
Page2.
<html>
<body>
<form action="test3.php" method="post">
Username: <br><input type="text" name="username"></br> <input
type="submit" name = 'submit1' value= 'Login'> </form> </body> </html>
Page3.
<?php
session_start();
?>
<html>
<body>
<?php
$username = $_POST['username'];
$_SESSION['username']= $_POST['username']; echo "<br> Hi
$username.</br>"; ?>
<form action="test4.php" method="post"> <input type="submit" name =
'submit' value= 'click me'> </form>
</body>
</html>
Page4.
<?php
session_start();
$username = $_SESSION['username'];
echo "<br> Hi $username.</br>";
?>
Php.ini
Session Support enabled
Registered save handlers files user sqlite Registered serializer
handlers php php_binary
session.auto_start Off Off
session.bug_compat_42 Off Off
session.bug_compat_warn Off Off
session.cache_expire 180 180
session.cache_limiter nocache nocache
session.cookie_domain no value no value session.cookie_httponly Off Off
session.cookie_lifetime 0 0 session.cookie_path /tmp /tmp
session.cookie_secure Off Off session.entropy_file no value no value
session.entropy_length 0 0 session.gc_divisor 1000 1000
session.gc_maxlifetime 1440 1440 session.gc_probability 1 1
session.hash_bits_per_character 5 5 session.hash_function 0 0
session.name PHPSESSID PHPSESSID session.referer_check no value no
value session.save_handler files files session.save_path /tmp /tmp
session.serialize_handler php php session.use_cookies On On
session.use_only_cookies On On session.use_trans_sid 0 0
Regards
-Hadi
As I said, your form is sent as POST, so this is a normal browser response
to
using the back button.
Thanks,
Ash
Aziz Saleh
2014-06-08 22:38:11 UTC
Permalink
Post by Ashley Sheridan
Ash,
Post by Ashley Sheridan
As I said, your form is sent as POST, so this is a normal browser
response
Post by Ashley Sheridan
to
using the back button.
How to get rid of it. any idea ?
Post by Ashley Sheridan
-----Original Message-----
Sent: Monday, June 09, 2014 12:48 AM
Subject: Re: [PHP] Webpage has expired
Post by hadi
Hi,
I'm facing trouble here when user click back button in the browser
after login it give him (Webpage has expired).
Can someone help here regard this matter.
Thanks.
My code
Page2.
<html>
<body>
<form action="test3.php" method="post">
Username: <br><input type="text" name="username"></br> <input
type="submit" name = 'submit1' value= 'Login'> </form> </body> </html>
Page3.
<?php
session_start();
?>
<html>
<body>
<?php
$username = $_POST['username'];
$_SESSION['username']= $_POST['username']; echo "<br> Hi
$username.</br>"; ?>
<form action="test4.php" method="post"> <input type="submit" name =
'submit' value= 'click me'> </form>
</body>
</html>
Page4.
<?php
session_start();
$username = $_SESSION['username'];
echo "<br> Hi $username.</br>";
?>
Php.ini
Session Support enabled
Registered save handlers files user sqlite Registered serializer
handlers php php_binary
session.auto_start Off Off
session.bug_compat_42 Off Off
session.bug_compat_warn Off Off
session.cache_expire 180 180
session.cache_limiter nocache nocache
session.cookie_domain no value no value session.cookie_httponly Off Off
session.cookie_lifetime 0 0 session.cookie_path /tmp /tmp
session.cookie_secure Off Off session.entropy_file no value no value
session.entropy_length 0 0 session.gc_divisor 1000 1000
session.gc_maxlifetime 1440 1440 session.gc_probability 1 1
session.hash_bits_per_character 5 5 session.hash_function 0 0
session.name PHPSESSID PHPSESSID session.referer_check no value no
value session.save_handler files files session.save_path /tmp /tmp
session.serialize_handler php php session.use_cookies On On
session.use_only_cookies On On session.use_trans_sid 0 0
Regards
-Hadi
As I said, your form is sent as POST, so this is a normal browser
response
Post by Ashley Sheridan
to
using the back button.
Thanks,
Ash
You can't, that is the way it is.

To avoid it you can either change your form from POST to GET or after
submition occurs do a header redirect.
Christoph Becker
2014-06-08 22:48:31 UTC
Permalink
Post by hadi
I'm facing trouble here when user click back button in the browser after
login it give him (Webpage has expired).
As Ashley already said, that is normal browser behavior. For an
explanation and a possible resolution see
<http://en.wikipedia.org/wiki/Post/Redirect/Get>.
--
Christoph M. Becker
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
hadi
2014-06-09 21:38:34 UTC
Permalink
Hi all,

I have figure it out.
I added (session.cache_limiter = must-revalidate) to my php.ini. and it's
working.

Thank you all for your support.

Loading...