|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
check if seesion has expired
I would like to know how to check if a session has expired and as such redirect the user to a page informing them of this. Can anyone help me with this?
|
|
#2
|
|||
|
|||
|
You can use
if ( $_SESSION['name'] == NULL ) { header ( "Location: http://newpage.com/newpage.html" ); } Or maybe if ( !session_is_registered('name') ) { header ( "Location: http://newpage.com/newpage.html" ); } |
|
#3
|
|||
|
|||
|
thanks
ill try that and see if it works out...thanks
|
|
#4
|
||||
|
||||
|
Also you can use
Code:
if(!session_id()){
header("Location:http://newpage.com/newpage.php");
}
checks to see if there is a valid session active let me know if that works.. HTH |
![]() |
| Viewing: Dev Articles Community Forums > Programming > General Programming Help > check if seesion has expired |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|