Get loggedin Session variables in Home Page

I got a members directory where u login.
1.How come they get killed when i refresh a page.
2.How do i get the loggedin session variable the home page.
so i know if current user is logged in.
The Application.cfc of the members is
<cfcomponent name="Application" displayname="Application
Component for the Login Security Tutorial" >
<cfset This.name = "NewLoveZoneAfrica">
<cfset This.applicationTimeout =
CreateTimeSpan(0,0,0,45)>
<cfset This.sessionManagement = "true">
<cfset This.sessionTimeout = CreateTimeSpan(0,0,0,30)>
<cfset This.clientManagement = "false">
<cfset This.loginstorage="session">
<cffunction name="onApplicationStart"
returntype="boolean" output="true">
<!--- Set up Application variables. Locking the
Application scope is not necessary in this method. --->
application starting
<cfset Application.configured = 1>
<cfset Application.datetimeConfigured = TimeFormat(Now(),
"hh:mm tt") & " " & DateFormat(Now(), "mm.dd.yyyy")>
<cfset Application.currentSessions = 0>
<!--- Begin Setting up request variables here. --->
<cfscript>
request.app = structNew();
Application.dsn = "LoveZoneAfrica";
Application.webRoot =
"#getPageContext().getRequest().getContextPath()#/NewLoveZoneAfrica/";
Application.machineRoot = "/NewLoveZoneAfrica/";
Application.cfcRoot = "NewLoveZoneAfrica.com";
Application.Domain = "NewLoveZoneAfrica.com";
factory=CreateObject("java","coldfusion.server.ServiceFactory");
sqlService = factory.getDataSourceService();
dsn = duplicate(sqlService.datasources[Application.dsn]);
if(dsn.driver eq "MSAccess" or dsn.driver eq "MSAccessJet"
or dsn.driver eq "ODBCSocket")
request.app.ucase = "ucase";
request.app.isAccess = true;
else
request.app.ucase = "ucase";
request.app.isAccess = false;
</cfscript>
<!--- End Setting up request variables here. --->
<cfreturn true>
</cffunction>
<cffunction name="onRequestStart" returntype="boolean"
output="true" >
<cfargument name="requestname" required=true/>
<cfif isDefined("form.j_username") and
isDefined("form.j_password")>
<!--- If either password or Username is empty go to
login--->
<cfif form.j_username is "" or form.j_password is "">
<cfinclude
template="#Application.webRoot#Login/Security/Login.cfm">
<cfabort>
</cfif>
<!--- First Check to see wether there is need to log out
user--->
<cfscript>
// create the Security object
Security =
createObject("component","#Application.cfcRoot#.security");
// store authenticate method of security object as roles
variable.
LogQry=Security.authenticate(form.j_username,form.j_password);
</cfscript>
<cfif LogQry.recordcount> <!--- User has
Successfully logged in #GetValidUser# --->
<cfloginuser name="#form.j_username#"
password="#form.j_password#" roles="#valuelist(LogQry.Role)#">
<!--- Update the LastLogin timestamp. --->
<cfscript>Update_LastLogin=Security.LastLogin(form.j_username);
</cfscript>
<cfset request.User.LoggedIn = "1">
<cfset request.User.Username = form.j_username>
<cfset request.User.LastLogin = LogQry.LastLogin_Date
>
<cfelse>
<!---Destroy request --->
<cflock scope="SESSION" throwontimeout="Yes" timeout="7"
type="EXCLUSIVE">
<cfset clearStruct = StructDelete(request, "User")>
</cflock>
<!---Destroy request --->
<cflock scope="SESSION" throwontimeout="Yes" timeout="7"
type="EXCLUSIVE">
<cfset clearStruct = StructDelete(SESSION, "User")>
</cflock>
</cfif>
<cfif NOT isDefined("request.User.LoggedIn")>
<cfset request.loginMessage ="Your Login Username or
Password is Invalid ">
<cfinclude
template="#Application.webRoot#Login/Security/Login.cfm">
<cfabort>
<cfelse>
<!--- If the login procedure is passed duplicate the
request structure into the Session scope. --->
<cflock scope="SESSION" throwontimeout="Yes"
timeout="107" type="EXCLUSIVE">
<cfset Session.User = Duplicate(request.User)>
</cflock>
<cflock name="lck_currentSessions" throwontimeout="Yes"
timeout="107" type="EXCLUSIVE">
<!---THIS has BE CHANgED : bEGIN- original COPY IS @ THE
FOOT --->
<!--- Copy identifying session information into the
Application scope. --->
<cfif NOT isDefined("Application.sessionData")>
<!--- Increment the number of current sessions. --->
<cfset Application.currentSessions =
Application.currentSessions + 1>
<cfset Application.sessionData = ArrayNew(1)>
<cfset Arraysize = 0>
<cfset Application.sessionData[Arraysize+1] =
form.j_username>
<CFELSE>
<!---check to see wether this "Username" appears in the
Application.sessionData.
If so, ignore. If no then append the name to the array so we
have a unique list of usernames--->
<cfset Arraysize = ArrayLen(Application.sessionData)>
<cfset Application.temp = ArrayNew(1)>
<cfif Arraysize>
<cfloop index = "LoopCount" from = "1" to =
"#Arraysize#">
<cfset #ArrayAppend(Application.temp,
Application.sessionData[LoopCount])#>
</cfloop>
<cfdump var="#Application.sessionData#" >
<cfset Isloggedin =
ListFind(ArrayToList(Application.temp), form.j_username)>
<cfif Isloggedin is 0>
<cfset Application.sessionData[Arraysize+1] =
form.j_username>
<!--- Increment the number of current sessions. --->
<cfset Application.currentSessions =
Application.currentSessions + 1>
</cfif>
<cfelse>
<!--- Increment the number of current sessions since twas
empty. --->
<cfset Application.currentSessions =
Application.currentSessions + 1>
<cfset Application.sessionData[Arraysize+1] =
form.j_username>
</cfif>
</cfif>
</cflock>
</cfif>
<cfelse>
<cfif not ListLast(CGI.SCRIPT_NAME, "/") EQ
"logout.cfm">
<!---Check wether the username appears on the list
Application.currentSessions is 0 --->
<cfif NOT isDefined("Session.User.LoggedIn") >
<cfinclude
template="#Application.webRoot#Login/Security/login.cfm">
<cfabort>
</cfif>
</cfif>
</cfif>
<!--- Check to see if a user is logged in on *every* cfm
page request. --->
<cfif not ListLast(CGI.SCRIPT_NAME, "/") EQ
"logout.cfm">
<cflock scope="SESSION" throwontimeout="Yes" timeout="7"
type="READONLY">
<cfif NOT isDefined("Session.User.LoggedIn")>
<cfinclude
template="#Application.webRoot#Login/Security/login.cfm">
<cfabort>
</cfif>
</cflock>
</cfif>
<cfreturn true>
</cffunction>
<cffunction name="onSessionEnd" returntype="void">
<cfargument name="SessionScope" required="true">
<cfargument name="ApplicationScope" required="true">
<cfset request.loginMessage="Nimeingia onSessionEnd">
<cflock name="lck_currentSessions" throwontimeout="Yes"
timeout="7" type="EXCLUSIVE">
<cfset sessionPosition =
ListFind(ArrayToList(arguments.ApplicationScope.sessionData),
arguments.SessionScope.sessionid)>
<cfif sessionPosition neq 0>
<cfset
ArrayDeleteAt(arguments.ApplicationScope.sessionData,
sessionPosition)>
<cfset arguments.ApplicationScope.currentSessions =
arguments.ApplicationScope.currentSessions - 1>
</cfif>
</cflock>
</cffunction>
<cffunction name="onSessionStart" returntype="void">
<cfset request.loginMessage="Nimeingia onSessionEnd">
</cffunction>
<cffunction name="onRequestEnd" returntype="void">
<!--- Write any code that needs to run when the page
request ends. This replaces onRequestEnd.cfm --->
</cffunction>
</cfcomponent>

Answered my own quests
http://www.rewindlife.com/archives/000046.cfm

Similar Messages

  • Inablility to retrieve values of session variables in irpt page

    We currently are using xMII 11.5.  We are having difficulty retrieving values assigned to our created session variables. 
    We have defined 2 users, each associated with session variables whose values differ by user.  Each user is associated with a different irpt page which retrieves information based on the values passed by the session variables.  Both pages return correct information in the grid using the as the param.1 value on the opening of the page. 
    On one page, we are able to retrieve the values of the session variables in Javascript by placing hidden fields on the document and using the document.getelementbyID("hiddenValue1").value.  The other irpt will only bring back the name of the of the session variable in the curly braces, .
    Both users are set up the same in System Security and Data Access.  If we switch the pages opened for the user in the Portal Navigation, one page will return the values no matter which user and the other page will always bring back the session variable name in the braces.  This makes us believe that it is not a problem with the user setup or the definition of the session variables.
    Would anyone be able to help us understand what needs to be done to correct this issue?

    Michelle,
    Have you tried URL encoding your irpt pass through parameters in your Navigation link?  Perhaps the commas and parenthesis are causing some issues ( http://help.sap.com/saphelp_xmii115/helpdata/en/Getting_Started/Template_Editor/Query_Construction.htm )
    Just to clarify, the Role/User attributes defined in LHSecurity are truly session properties, and the session properties are shown by the PropertyAccessServlet results.  Adding the name/value pairs to the URL are only a one-shot pass through to the ReportServlet that processes web pages with .irpt extenstions, so they don't actually set the session properties and are non-retentive beyond the one page.  As you are presently doing with the navigation links, we typically recommend URL passthroughs for page to page activities and using the session itself for name/value pairs that you want to set once and use anywhere throughout your application.
    document.APPLET.getPropertyValue(NAME); will also give you access to the session through javascript, but if you do a view...source in the browser after your TeamLeaderView web page has loaded you should see the results of the search/replace efforts of the ReportServlet, and the javascript you are using to get values out of hidden form field elements should simply reflect the text you see in the view source window.
    If they work inside APPLET tags like you mentioned for Param.1 you could also use document.APPLET.getQueryObject().getParam(1); instead of the hidden form field elements, and remember that you have 32 params and if they are not used in the underlying query can provide a very nice place to 'catch' the results like you are are doing with hidden form field elements that could potentially get reset by a form button.
    Regards,
    Jeremy

  • How can I set home page for a new tab? how can i get firefox to open the home page every time i open a new tab in Windows vista home basic??

    How can I set home page for a new tab? how can i get firefox to open the home page every time i open a new tab in Windows vista home basic??
    == This happened ==
    Every time Firefox opened

    Firefox can have multiple home pages if you wish. Each home page that will open when starting Firefox is separated by the "|" character.
    See: http://support.mozilla.com/en-US/kb/How+to+set+the+home+page
    To have new tabs open a specific web site, add one of the following extensions:
    http://sogame.awardspace.com/newtaburl/
    https://addons.mozilla.org/en-US/firefox/addon/777

  • How can i get my imac proceed to home page from restarting endlessly?  it will start then start booting then chime then bck to step one, not even hitting the start up page.... plssss help!

    how can i get my imac proceed to home page from restarting endlessly?  it will start then start booting then chime then bck to step one, not even hitting the start up page.... plssss help!

    Hi
    My Powerbook was the same. Only fix is to reinstall OSX from the install CD but be sure not to pick the Format and install clean. Once you boot with the install CD pick the preserve user data and settings.
    On My machine the reinstall looked perfect. My network, email, files and all the programmes were all there. Most apps worked fine but Adobe CS2, Virtual PC and NetBarrier all needed reinastallation as they reported a few files or registration was missing. I went for the 10.4.3 upgrade again and it worked fine.
    Good luck
    D

  • How to get Google on my internet home page and not at&t

    when I go into the internet on my phone AT&T window comes up instead of Google. How do I get Google to be my home page?
    Any help will be appreciated.
    Thanks

    When in your browser, go to 'settings'.  There should be an option to set the home page, where you can change it to whatever you want.
    Out of curiosity, how did it get AT&T as a home page if you have a Verizon phone?

  • I downloaded bearshare yesterday,,i used to be able to click on firefox and google was my homepage,but ever since i downloaded bearshare when i click on bearshare is my homepage,,how do i get back google as my home page?

    I have firefox as my browser,ever since i downloaded bearshare for music! that comes up as my homepage,,i want to be able to click on firefox and get back google as my home page,how can i do this,,Thanks..

    See:
    * http://www.ehow.com/how_6609141_remove-bearshare-spyware.html
    See also these forum threads about BearShare:
    * [/questions/762144]
    * [/questions/700250]

  • How do I get Yahoo back as my home page...Firefox dominates. I had to download Firefox to take and online exam.

    I had to download Firefox in order to take some tests online for continuing education.
    I have lost Yahoo as my homepage and have your site instead.
    How do I get yahoo back as my home page?
    I do not want Firefox as my home page...It has also wrapped itself around the Internet Explorer Icon on my desktop.
    I do not want to install another program.
    Thank you.

    How about a reply from Firefox by a person.
    I am totally frustrated with Firefox and at this point, I will finish the class as soon as possible so i can remove your program from my computer.
    So again, Help!

  • I keep getting booted back to the home page when trying to open apps.

    When trying to launch an app I get booted back to the home page.

    Hey there marvel10,
    I understand that you are experiencing issues with your ability to launch certain apps on your iPad. There is an article on Apple’s knowledge base about this issue, and the article can be found below:
    If an app you installed unexpectedly quits, stops responding, or won’t open - Apple Support
    http://support.apple.com/en-us/HT201398
    Thanks for being a part of the Apple Support Communities!
    Cheers,
    Braden

  • HT6129 when i click the "connect to itunes" on disney movies anywhere's website I get connected to the itunes home page. It will not let me connect. What is going on?

    when i click the "connect to itunes" on disney movies anywhere's website I get connected to the itunes home page. It will not let me connect. What is going on?

    Follow the steps in the article you linked to this forum, it has the steps you need to follow to restore the iPod in recovery mode.

  • How to get the session variable value in JSF

    Hi
    This is Subbus, I'm new for JSF framewrok, i was set the session scope for my LoginBean in faces-config.xml file..
    <managed-bean-name>login</managed-bean-name>
    <managed-bean-class>LoginBean</managed-bean-class>
    <managed-bean-scope>session</managed-bean-scope> like that...
    So all parameter in LoginBean are set in session right ?... for example i used userId is the Parameter...
    Now i need to get the the userId parameter from that session in my another JSP page.. how i get that ?..
    Already i tried
    session.getAtrribute("userId");
    session.getValue("userId");
    but it retrieve only "null" value.. could u please help me.. it's very urgent one..
    By
    Subbus

    Where i use that..is it in jsp or backend bean...
    simply i use the following code in one backend bean and try to get the value from there bean in the front of jsp page...
    in LogoutBean inside
    public String getUserID()
         Object sessionAttribute = null;
         FacesContext facescontext=FacesContext.getCurrentInstance();
         ExternalContext externalcontext=facescontext.getExternalContext();
         Map sessionMap=externalcontext.getSessionMap();
         if(sessionMap != null)
         sessionAttribute = sessionMap.get("userId");
         System.out.println("Session value is...."+(String)sessionAttribute);
         return (String)sessionAttribute;
         return "fail";
    JSP Page
    <jsp:useBean id="logs" scope="session" class="logs.LogoutBean" />
    System.out.println("SS value is ...."+logs.getUserID());
    but again it retrieve only null value.. could u please tell me first how to set the session variable in JSF.. i did faces-config only.. is it correct or not..
    By
    Subbus

  • How can I get Firefox to except the home page that I want to use

    I have clicked and dragged the icon a hundred times, and still when I click on Firefox a previously set up home page appears.
    This is very annoying because I can get to my homepage; but I have to sign on to yahoo e-mail every time; then go to my homepage and my bookmarks. I can't seem to get it to except the homepage I want to use..

    If you want a customize Yahoo! page then make sure that you keep the Yahoo! cookies.
    Such details are stored in a cookie.
    * Create an allow cookie exception (Tools > Options > Privacy > Cookies: Exceptions) to keep such a cookie, especially for secure websites and if cookies expire when Firefox is closed.
    * In [[Private Browsing]] mode all cookies are session cookies that expire if that session is ended, so websites won't remember you.
    * In [[Private Browsing]] mode Firefox won't fill names and passwords automatically.
    * You enter Private Browsing mode if you select: Tools > Options > Privacy > History: Firefox will: "Never Remember History"
    * To see all History and Cookie settings, choose: Tools > Options > Privacy, choose the setting <b>Firefox will: Use custom settings for history</b>
    * Uncheck: [ ] "Permanent Private Browsing mode"
    * Do not use [[Clear Recent History]] to clear the "Cookies" and the "Site Preferences"
    Clearing "Site Preferences" clears all exceptions for cookies, images, pop-up windows, software installation, and passwords.
    * http://kb.mozillazine.org/Cookies

  • Set session variables inside a page

    Inside the page "form.cfm" I have this code:
    <form name="report" action="pagestatistic.cfm"
    method="post">
    <INPUT name=ONE size=15 >
    <INPUT name=TWO size=15 >
    <input type="submit" value="Go ON">
    </form>
    I would like to set session variable: ONE and TWO, inside the
    page: pagestatistic.cfm
    IN that way when I will refresh the page "pagestatistic.cfm"
    I will watch have the same results.
    I added this code at the top of "pagestatistic.cfm" but it
    doesn't work.
    <CFSET session.ONE = #ONE#>
    <CFSET session.TWO = #TWO#>
    Could you tell me what goes wrong?
    Thanks
    CFWork

    quote:
    Originally posted by:
    liquid One
    When you say refresh the page, do you mean submit the form by
    clicking on the submit button? Or are you filling out the input
    boxes and hitting refresh?
    I mean I clicked a link that links the same page:
    pagestatistic.cfm
    Then I would like to add to this link 2 get variables
    pagestatistic.cfm?ColorPage=Green&Order=2 to change the
    background color and the order of the results of the page. That it
    is impossible because when i refresh the page it is doesn't work.
    What do you suggest me to do?
    Thanks,
    CfWork

  • I tried to download a Cisco webex application.  The app did not download and I also can't open the app.  The problem is that I can't get the webex screen to close, it is stuck open and I can't get back to the app home page!

    I tried to download a Cisco website application.   The app did not download and it is stuck on the window where it has the option of open.....it will not open.  The problem is that I cannot get the window off the screen and I can't get back to the App Store home page!   Help! Thanks

    Try this.
    Reset the iPad by holding down on the sleep and home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider if it appears on the screen - let go of the buttons. Let the iPad start up.

  • Ran Malware ANTI Malware on windows 7 64 bit PC now cannot get my tools menue on home page

    I am getting a lot of survay's popping up on my PC so I downloaded the free version of Malware Bytes Anti Malware, it took out my tools menue from my home page and adobe air aswell as HP smart web print along with some other programs, I have most back now, redownloaded windows
    photo gallery and movie maker and adobe air but I cannot get my tools menue back or HP smart web print, I do not think smart web print could be a virus as it was downloaded from HP web site.
    Using IE 9, can anyone help please.

    A bit of repetition, mainly for the benefit of anyone else with the same issue. In your case the "for older video cards" version might be worth a try.
    When cleaning folders you need to check both the Program Files and Program Files (x86) folders, which you may well have done but didn't mention in the detail above.
    For general advice see Troubleshooting issues with iTunes for Windows updates.
    The section Install missing components has advice on breaking down the iTunes installer into the individual .msi files which might prove useful if Apple Mobile Device Support won't install normally.
    The steps in the second box are a guide to removing everything related to iTunes and then rebuilding it which is often a good starting point unless the symptoms indicate a more specific approach. Review the other boxes and the list of support documents further down the page in case one of them applies.
    The further information area has direct links to the current and recent builds in case you have problems downloading, need to revert to an older version or want to try the iTunes for Windows (64-bit - for older video cards) release as a workaround for performance issues or compatibility with third party software.
    Your library should be unaffected by these steps but there is backup and recovery advice elsewhere in the user tip.
    tt2

  • How do I get Firefox to open my home page whenever I open a new tab?

    I have Google as my home page. Rather than opening a new tab and getting a blank page, I'd like to open a new tab and get Google coming up. I'm fairly certain that this was possible in old Firefox, and would like to know if it is still possible and if so how!?! Thanks!

    Firefox can have multiple home pages if you wish. Each home page that will open when starting Firefox is separated by the "|" character.
    See: http://support.mozilla.com/en-US/kb/How+to+set+the+home+page
    To have new tabs open a specific web site, add one of the following extensions:
    http://sogame.awardspace.com/newtaburl/
    https://addons.mozilla.org/en-US/firefox/addon/777

Maybe you are looking for

  • Error shown in t1.trc file

    Hello all, i am working on EDI X12 over Internet transaction given in user guide.after completing everything in B2B UI tool on both acme and globalchips servers.i ran deq.bat file on both servers giving s*ubscriber=b2berroruser* and wait=1 in ipdeque

  • Organizer in PSE 11 hangs on catalog converted from PSE8

    I just installed PSE 11 and converted my catalog from PSE 8.  I have over 50,000 images in the catalog.  Immediately the Organizer starts on the people recognition (I had all Auto-Analyze turned off in PSE8).  I am able to cancel the People Recogniti

  • Macbook 3,1 late 2007 palmrest crack

    Hi I have just recently found out that Apple has claimed that the crack is a manufacturing defect and that it was replacing them regardless of waranty. Am i too late to get mine replaced? Does anybody have a recent experience? Thanks for your anwser.

  • [svn:fx-trunk] 15779: * Package and class level javadoc for the flex2. compiler.mxml package

    Revision: 15779 Revision: 15779 Author:   [email protected] Date:     2010-04-27 20:19:48 -0700 (Tue, 27 Apr 2010) Log Message: Package and class level javadoc for the flex2.compiler.mxml package   and subpackages. QE notes: Doc notes: Bugs: Reviewer

  • ITunes could not connect to this iPhone. Could not connect to the device.

    iTunes could not connect to this iPhone. Could not connect to the device. This is the error message I get when I try to sync with iTunes now.  I suspect the problem is that I replaced my hard drive on my MBP, but I can't find this particular problem