PHP 클래스 Session, huge

상속: extends CI_Session
파일 보기 프로젝트 열기: panique/huge 1 사용 예제들

공개 메소드들

메소드 설명
add ( mixed $key, mixed $value ) adds a value as a new array element to the key.
destroy ( ) deletes the session (= logs the user out)
get ( mixed $key ) : mixed gets/returns the value of a specific key of the session
init ( ) starts the session
isConcurrentSessionExists ( ) : boolean checks for session concurrency
set ( mixed $key, mixed $value ) sets a specific value to a specific key of the session
updateSessionId ( string $userId, string $sessionId = null ) : string update session id in database
userIsLoggedIn ( ) : boolean Checks if the user is logged in or not

메소드 상세

add() 공개 정적인 메소드

useful for collecting error messages etc
public static add ( mixed $key, mixed $value )
$key mixed
$value mixed

destroy() 공개 정적인 메소드

deletes the session (= logs the user out)
public static destroy ( )

get() 공개 정적인 메소드

gets/returns the value of a specific key of the session
public static get ( mixed $key ) : mixed
$key mixed Usually a string, right ?
리턴 mixed the key's value or nothing

init() 공개 정적인 메소드

starts the session
public static init ( )

isConcurrentSessionExists() 공개 정적인 메소드

This is done as the following: UserA logs in with his session id('123') and it will be stored in the database. Then, UserB logs in also using the same email and password of UserA from another PC, and also store the session id('456') in the database Now, Whenever UserA performs any action, You then check the session_id() against the last one stored in the database('456'), If they don't match then log both of them out.
또한 보기: Session::updateSessionId()
또한 보기: http://stackoverflow.com/questions/6126285/php-stop-concurrent-user-logins
public static isConcurrentSessionExists ( ) : boolean
리턴 boolean

set() 공개 정적인 메소드

sets a specific value to a specific key of the session
public static set ( mixed $key, mixed $value )
$key mixed key
$value mixed value

updateSessionId() 공개 정적인 메소드

update session id in database
public static updateSessionId ( string $userId, string $sessionId = null ) : string
$userId string
$sessionId string
리턴 string

userIsLoggedIn() 공개 정적인 메소드

Checks if the user is logged in or not
public static userIsLoggedIn ( ) : boolean
리턴 boolean user's login status