#!/usr/bin/python3
########################################################
# Access a previous web session
########################################################
import os
import sessionFunc

print('Content-Type: text/html')
print('\n')

sessionId = sessionFunc.getSessionId()
if not sessionId:
    sessionId = 'no session'

print("<b>Session Id:</b>", sessionId, "<br>")

started   = sessionFunc.getSessionVar('_session_start_time')
firstname = sessionFunc.getSessionVar('fname')
print(firstname, "you have been logged in since:", started, "<br>")

sessionFunc.delSessionVar('gender')
print("variable 'gender' has been deleted <br>")
print('<br>')

allvars = sessionFunc.getSessionVars()
print(allvars)




#=== link to see the python code =================================================
import os, sys
sys.path.insert(0,'/home/s/sultans/web/python/demo')
import zCode                          #import func to display the Python code
filename = os.path.abspath(__file__)  #get absolute file name 
zCode.display(filename)               #call it
#=================================================================================