Jump to content

Question about tutorial I am reading


anon

Recommended Posts

Hi, I'm reading a tutorial over at - http://www.phpeasystep.com/workshopview.php?id=6

 

It says that to terminate the session I should create a file:

<?
session_start();
session_destroy();
?>

 

 

If a user wanted to logout, would I make the Logout Button link to this file or something?

Link to comment
https://forums.phpfreaks.com/topic/86008-question-about-tutorial-i-am-reading/
Share on other sites

<?php
session_start();
session_destroy();

// Use a 301 redirect rather than a meta
Header( "Location: http://www.new-url.com" ); 
exit;
?>

 

Any link connecting to this php page will end the session and send them to the login page.  You don't have to use a form =D 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.