API16

JSession/getFormToken

< API16:JSession

The "API16" namespace is an archived namespace. This page contains information for a Joomla! version which is no longer supported. It exists only as a historical reference, it will not be improved and its content may be incomplete and/or contain broken links.

Description

Method to determine a hash for anti-spoofing variable names



Syntax

static getFormToken($forceNew=false)
Parameter Name Default Value Description
$forceNew false

Returns

string Hashed var name

Defined in

libraries/joomla/session/session.php

Importing

jimport( 'joomla.session.session' );

Source Body

public static function getFormToken($forceNew = false)
{
        $user                   = &JFactory::getUser();
        $session                = &JFactory::getSession();
        $hash                   = JApplication::getHash($user->get('id', 0).$session->getToken($forceNew));
        return $hash;
}



Examples

Code Examples


Advertisement