Jump to content

How do i make a 'log out' button with postgresql?


iNko

Recommended Posts

Hey again, was making a registration form with php and postgresql and  im stuck at making a 'log out' button, i need to make something simple like - press on a link, it redirects u to the index page and if u try to go 'back' it wouldn't let u..

 

I found something on google like this:

<a href="test.php?logout=1">Log out</a>

 

and on test.php:

<?php
if(isset($_GET['logout'])){
session_unset;
session_destroy;
}
?>
Succesfully logged out, go back to index page: <a href="index.php">Home</a>

 

but i didnt use any sessions at all.. is there something like 'session_destroy' with postgre? i mean smth like 'pg_desroy'?

Link to comment
Share on other sites

 

I found something on google like this:

<a href="test.php?logout=1">Log out</a>

 

and on test.php:

<?php

if(isset($_GET['logout'])){

session_unset;

session_destroy;

}

?>

 

but i didnt use any sessions at all.. is there something like 'session_destroy' with postgre? i mean smth like 'pg_desroy'?

 

I don't know anything about postgre, but, you're not checking for the existence of a session, nor the proper value of a session being set, nor even the proper value of logout.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.