|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
session_register or $_SESSION
I am using PHP 4.3 (the latest php)
i have heard that we should use $_SESSION rather than session_register to register a session...is it true? also I should no longer use session_is_registered() or anything alike....i should use isset($_SESSION()) instead.... can anyone give comments about the usage of session in PHP4.3 or the latest version... AND, a big problem, i ran the following code and it is not working until i refresh it for few or more times...it said that DNS error and server is not found...why's that? <?php session_start(); $fromPage = "/kenny/item_details.php"; if (isset($_SESSION['userid'])){ ?> okay , YOU ARE LOGGED IN !!! <a href="/kenny/TestSession/logout.php"> LOGOUT </a> <? } else { ?> Not okay, You are not logged in !!! <? } ?> |
|
#2
|
||||
|
||||
|
I would recomend using $_SESSION[] just for ease of use..
and if you do use $_SESSION[] you are right, you will need to use isset($_SESSION[]) Not sure why that code isnt working, unless you're not setting $_SESSION['userid'] = something in another part of the code.. as long as you're setting $_SESSION['userid'] to a value then it should work.. |
![]() |
| Viewing: Dev Articles Community Forums > Programming > General Programming Help > session_register or $_SESSION |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|