Actions

API16

JSession/getFormToken

From Joomla! Documentation

< API16:JSession
Revision as of 17:42, 22 March 2010 by Doxiki (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Replacement filing cabinet.png
This Namespace has been archived - Please Do Not Edit or Create Pages in this namespace. Pages contain information for a Joomla! version which is no longer supported. It exists only as a historical reference, will not be improved and its content may be incomplete.

Contents

Description

Method to determine a hash for anti-spoofing variable names

[Edit Descripton]

Description:JSession/getFormToken

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;
}

[Edit See Also] SeeAlso:JSession/getFormToken

Examples

<CodeExamplesForm />