Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

How to check if a session is expired or never was set in php

session_start();
if ($_COOKIE(session_name() && !count($_SESSION)) {
    print "session has expired";
    exit;
} elsif (!$_COOKIE(session_name()) {
    print "You need to login first";
    exit;
} else {
    print "welcome back....";
    ....
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #How #check #session #expired #set #php
ADD COMMENT
Topic
Name
1+8 =