1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Webpage has expired' !!!

Discussion in 'PHP' started by mahdi_fci3, Jul 15, 2010.

  1. #1
    Hi,
    some one said me the problem of getting 'web page has exired' is from session and he said me use this code:

    
      // log out if no session
      if (!isset($_SESSION['UserName'])) {
    	if (isset($_SESSION)) {
    	  while (list ($key, $val) = each ($_SESSION)) {
    		session_unregister($key);
    	  }
    	  session_destroy();
    	}
    	header("Location: ../index.php");
    	exit();
    		
      }
    
    
    PHP:
    and I include this code to every page using include("session.php");
    but I stiil have the same problem: WEB PAGE HAS EXPIRED when I press back button of Explorer, so could some body help me !!!!!!!!!!!!!

    thank u 4 ur time
     
    mahdi_fci3, Jul 15, 2010 IP
  2. mahdi_fci3

    mahdi_fci3 Peon

    Messages:
    31
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    please, plaese ,plaese help me from this error?
    if I click the back button of the browser the error message display " web page has expired" and I dont know the reason??
    can some one help me ???????
     
    mahdi_fci3, Jul 25, 2010 IP
  3. Ishana

    Ishana Peon

    Messages:
    52
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    i don´t get what you want.
    Have you tried to delete your browser cache & cookies? What happen if you reload the page instead of hitting the back button?
     
    Ishana, Jul 25, 2010 IP
  4. TrySparta

    TrySparta Well-Known Member

    Messages:
    279
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    120
    #4
    That's because the session has closed. When you hit the back button, it goes back to the previous page as it was when it was loaded. The page has therefore, expired.
     
    TrySparta, Jul 25, 2010 IP
  5. Zeh.

    Zeh. Peon

    Messages:
    57
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    // log out if no session
      if (!isset($_SESSION['UserName'])) {
        if (isset($_SESSION)) {
          while (list ($key, $val) = each ($_SESSION)) {
            session_unregister($key);
          }
          session_destroy();
        }
        header("Location: ../index.php");
        exit();
           
      }
    PHP:
    That's session.php?
    If so, add before all a session_start();
     
    Zeh., Jul 25, 2010 IP
  6. mahdi_fci3

    mahdi_fci3 Peon

    Messages:
    31
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Thanks all
    if I reload or click the back button I get the same error, really I don't know how to delete browser cache & cookies.
    if I submit a form to another page and I need to back the page of form by clicking the back button of the browser I get " the page has expired "
     
    mahdi_fci3, Jul 26, 2010 IP
  7. tjkn

    tjkn Peon

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    http://www.wikihow.com/Clear-Your-Browser's-Cache
    hope that will help u
     
    tjkn, Jul 26, 2010 IP
  8. Jeehan

    Jeehan Well-Known Member

    Messages:
    1,578
    Likes Received:
    31
    Best Answers:
    1
    Trophy Points:
    115
    #8
    What hapens if you press CTRL+F5 ?
     
    Jeehan, Jul 26, 2010 IP
  9. mahdi_fci3

    mahdi_fci3 Peon

    Messages:
    31
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    thanks tjkn & Jeehan
    tjkn, the link u send is concerned my PC only but what I need is, when the user of web site that I created click the submit button then user need to back by clicking the back button of the browser they get message error " web page has expired".
    Jeehan if I press CTRL+F5 the message error disapear, but I dont like to see this message at all instead of pressing f5 or CTRL+F5 here is the code of my page
    
    session_start(); 
    session_regenerate_id(true);
    if ((!isset($_SESSION['Username'])) || (empty($_SESSION['Username'])) ) {
    header("Location: Sign_out.php");
    exit();
    }
    
    PHP:
    every page of my web site that containe this code -by including of writing at top of the page - will display error message (web page has expired) if I press back button of the browser.
    So is there somthin wrong in this code ??
    please, please help me !!!!!!!!!!!!!!!!!!
     
    Last edited: Jul 28, 2010
    mahdi_fci3, Jul 27, 2010 IP