session_validate: Validate sbtools session state

View source: R/session_validate.R

session_validateR Documentation

Validate sbtools session state

Description

A session is considered valid if it is NULL or a true, non-expired SB session

Usage

session_validate(session = current_session())

Arguments

session

sbtools session object (from authenticate_sb)

Details

This validates the underyling RCurl session. The session object becomes invalid if the R session has been saved to disk or persisted through an R restart. This verifies that the session object is either valid, or is a NULL object, which means no session state is being persisted. Note, this does not verify the credentials are valid or that you have permission to access the SB item, so it does not guarantee a successful request.

Value

TRUE/FALSE indicating if session is valid and can be used. Returns TRUE if session is NULL as well.

Examples

## Not run: 
session = authenticate_sb('user@usgs.gov')

#return true as underlying RCurl session is valid
session_validate(session)

## End(Not run)


sbtools documentation built on May 1, 2023, 1:07 a.m.