|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
mpk Smarty Rookie
Joined: 26 Jun 2003 Posts: 9 Location: Amsterdam, Netherlands
|
Posted: Sat Aug 02, 2003 3:35 pm Post subject: Authentication form (many hours stuck)... |
|
|
I have a login.php like this:
ini_set('session.name', 'mysession');
ini_set('session.cookie_lifetime', 1800);
session_start();
.....
$smarty->display("login.tpl");
And a logout like this:
session_start();
session_unset();
setcookie (session_name(), '', (time () - 2592000), '/', '', 0);
session_destroy();
header("Location: login.php");
exit;
It looks like that the session (and cookies and everything) is effectively destroyed but when i come again to the login screen and I press reload from my browser it informs me that my form has to be resend and if I confirm I login again. I think I'm missing something simple here (clear cache or something like this?) but I cannot find what.
Any ideas please?
Thanks.- |
|
Back to top |
|
CirTap Smarty Pro
Joined: 04 Jun 2003 Posts: 106
|
Posted: Tue Aug 05, 2003 12:25 pm Post subject: Use no-cache + challenge/response hash |
|
|
Quote: | It looks like that the session (and cookies and everything) is effectively destroyed but when i come again to the login screen and I press reload from my browser it informs me that my form has to be resend and if I confirm I login again. |
you mean using the back-buttons of your browser?
You can solve this in two ways:
- first make sure that login.php is not been cached by the browser, by adding all the killers like 'no-cache', 'expire' etc. with header()
- use a challenge-response field/session var to control, if a form has already been submitted - in any open instance/browser.
I assume you can handle the cache stuff (or find some page telling you how), the other thing is explained here how to detect reloads/duplicated windows
Have fun,
CirTap |
|
Back to top |
|
mpk Smarty Rookie
Joined: 26 Jun 2003 Posts: 9 Location: Amsterdam, Netherlands
|
Posted: Wed Aug 13, 2003 12:04 pm Post subject: |
|
|
Challenge-Response was what I was missing. Not exactly smarty...
Many thanks for this.
Cheers |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|