PDA

Visualizza versione completa : Problema con i cookye


ravint
28-12-2002, 23.14.21
sto cercando di usare questo script...tuttavia ho notato una discussione che riporto in originale:

how to check the cookie?
I've got authlib up-and-running perfectly, with my own
fields and a couple of other additions; however, how
do I then check for the existence of the cookie on
other pages I want to have access restricted to?

in poche parole dice come si fa a far girare l'utente nelle pagine riservate una volta riconosciuto dal sistema ed evitare altri non riconosciuti ad aprire le pagine riservate.... questa e' stata la risposta:

To do this, I have found that you need to do the following.

1.) modify backend.php and change the call to setcookie in
the login function to include the path to be "/" if
you
want the cookie to be available outside of the authlib
directory structure.

setcookie("authlib", "$username:$hash:$id",time()+3600, "/");

2.) then to check the cookie, make sure that your page is a
php page, and include the following code:

<?
require ("backend.php");
$login_check = $authlib->is_logged();

if (!$login_check)
{
//User is not logged in.
}
else{
//User is logged in.
}
?>


I think that should do it for you.

bhe io ho provato ad inserire lo script da lui citato nelle pagine riservate ma a me non funziona.... sbaglio qualche cosa???

mi potete aiutare a completare questo script dato che ancora non sono riuscito a trovare uno script come si deve e completo visto che io non sono in grado di farmene uno

ciao
grazie
Massimo
***************