View on
MetaCPAN is shutting down
For details read Perl NOC. After June 25th this page will redirect to
Nate Lewis > FWS-V2 > FWS::V2::Session



Annotate this POD


New  1
Open  0
View/Report Bugs
Module Version: 1.13091122   Source  


FWS::V2::Session - Framework Sites version 2 session related methods


Version 1.13091122


    use FWS::V2;
    my $fws = FWS::V2->new();

    $fws->saveFormValue( 'thisThing' );


FWS version 2 session methods are used to manipulate how a session is maintained, authenticated, and initiated.



Return a list of all the available form values passed.

    # get the array
    my @formArray = $fws->formArray();


Get or set a form value. If the value was not set, it will always return an empty string, never undefined.

    # set the form value
    $fws->formValue( 'myVar', 'This is what its set to' );

    # get the form value and pass it to the html rendering
    $valueHash{html} .= $fws->formValue( 'myVar' );


Retrieve the GUID for the fws site. If it does not yet exist, make a new one.

    print $fws->fwsGUID();


Gather the passed form values, and from it set the language formValue and the session formValue.

    # get the array


Set the session for a FWS web based page rendering.

    # Set the session


Determine the site friendly url and set it.

    # Set the site friendly URL


Get or set the current language. If no language is currently set, the first entry in language will be used. If languageArray has not be set, then 'EN' will be used. The language can be set by being passed as a form value with the name 'fws_lang'.

    # set the language
    $fws->language( 'FR' );

    # get the language
    $valueHash{html} .= 'The current language is: ' . $fws->language() . '<br />';    


Set the languages the site will use. The first one in the list will be considered default. If languageArray is not set it will just contain 'EN'.

    # set the languages available
    $fws->languageArray( 'EN', 'FR', 'SP' );


Process the web action for logins

    # Run login


Log out FWS admin user

    # Log out currently logged in admin user


Log out FWS site user

    # Log out currently logged in site user


Crypt password passing the crypt mmethod you would like to use. Set $fws->{FWSCrypt} to set method. Current default is perl crypt.

Current Methods: crypt: Perl default crypt

Example: # # Log out currently logged in site user # my $cryptedPass = $fws->cryptPassword( 'thePasswordYourCrypting' );


Mark a formValue to remain persistant with the session. The return of this function will be the current saveWithSessionHash.

    # This should go in a 'init' element or located int he file
    # at any point it can be referenced via formValue
    $fws->saveFormValue( 'myCity' );


Commit the current session to the sessions table. This is only needed if you need to cmmit the session before you perform a 302 redirect or if yuor immitating the pringPage() method with a custom one. Not the session does actually do anything if its values have not chagned from its innital load from the session table.

    # This should go in a 'init' element or located int he file
    # at any point it can be referenced via formValue


Set default values derived from the site settings for a site. This will also set the formValue 'p' to the homeGUID if no 'p' value is currently set.

    # currently rendered site

    # set site values for some other site
    $fws->setSiteValues( 'othersite' );


Get or save a siteValue for the session.

    # save something
    $fws->siteValue( 'something', 'this is something' );

    # get something
    my $something = $fws->siteValue( 'something' );


Get an admin user value. This is used mostly for security flags and is only used to get values FWS has set.

    # is the admin user a developer?
    my $isDeveloper = $fws->userValue( 'isDeveloper' );


Nate Lewis, <nlewis at>


Please report any bugs or feature requests to bug-fws-v2 at, or through the web interface at I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.


You can find documentation for this module with the perldoc command.

    perldoc FWS::V2::Session

You can also look for information at:


Copyright 2013 Nate Lewis.

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See for more information.

syntax highlighting: