Jump to content


Photo

session or browser problem?


  • Please log in to reply
4 replies to this topic

#1 apol

apol
  • Members
  • PipPip
  • Member
  • 13 posts

Posted 04 October 2006 - 09:41 AM

Hi,

I have a problem with sessions or browser which i describe below:

1) I have a form (form.php) with 2 text fields 1-->userName 2--->passwd.
2) User fill in the form and submit it.
3) The form_check.php file starts a session and proccess the requested form, if the form fields are valid then i set this $_SESSION['userPass']="go";
4) When user decides to log-out  press log_out link and the log_out.php is executed.
5) Here is the log_out.php:

<?php
session_start();
$_SESSION[]=array();
if (isset($_COOKIE[session_name()])) {
  setcookie(session_name(), '', 0, '/');
}
session_unset();
session_destroy();

?>

and some html follows...
-----------------------------------------

I checked the session(after user log_out) and it has destroyed. But when i press Back button of Internet Explorer it saids me that if i press F5 or Refresh button i could see the requsting page.
And i am doing that, and the page appears, i also ckecked the session and it has created again.
Why is that happening? How could i avoid it?
I am confused...

Thanks a lot

Adreas

#2 JasonLewis

JasonLewis
  • Members
  • PipPipPip
  • Advanced Member
  • 3,351 posts
  • LocationVictoria, Australia

Posted 04 October 2006 - 09:56 AM

are you red-directing the user after they logout. i suggest you re-direct them to a confirmation page for the logout or something.
Good luck with your coding.
Jason / ProjectFear / Jaysonic

#3 ponsho

ponsho
  • Members
  • PipPip
  • Member
  • 24 posts

Posted 04 October 2006 - 10:01 AM

Maybe the problem is that when you press back you are trying to go to the page where you have just login so you are creating the session again.

#4 apol

apol
  • Members
  • PipPip
  • Member
  • 13 posts

Posted 04 October 2006 - 10:55 AM

Maybe the problem is that when you press back you are trying to go to the page where you have just login so you are creating the session again.


Yes that is the main problem but how could i avoid it?

#5 apol

apol
  • Members
  • PipPip
  • Member
  • 13 posts

Posted 04 October 2006 - 10:58 AM

are you red-directing the user after they logout. i suggest you re-direct them to a confirmation page for the logout or something.


I try to redirect( with headers() function right? ) the user to the log_in page but the problem still exists?





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users