# How to Authenticate on a login page and be authenticated on application page

**URL:** <https://community.dreamfactory.com/t/how-to-authenticate-on-a-login-page-and-be-authenticated-on-application-page/1170>\
**Category:** Authentication & Security\
**Created:** [June 9, 2015, 1:34pm UTC](https://community.dreamfactory.com/t/how-to-authenticate-on-a-login-page-and-be-authenticated-on-application-page/1170 "2015-06-09T13:34:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeebee](https://avatars.discourse-cdn.com/v4/letter/j/e19adc/32.png) [@jeebee](https://community.dreamfactory.com/u/jeebee)\
**Post date:** [June 9, 2015, 1:34pm UTC](https://community.dreamfactory.com/t/how-to-authenticate-on-a-login-page-and-be-authenticated-on-application-page/1170/1 "2015-06-09T13:34:05Z")

</div>

Hello all,

still looking to resolve issue with dreamfactory javascript SDK  
what i want to do

have a loging page for authentification : ok  
based on example provided in SDK

```
window.app.login = function () {
        var body = {
            email: document.getElementById("email").value,
            password: document.getElementById("password").value
        };
        window.df.apis.user.login({body: body}, function (response) {
            //assign session token to be used for the session duration
            document.getElementById("login-status").innerHTML = "Logged In"
            window.authorizations.add("X-DreamFactory-Session-Token", new ApiKeyAuthorization("X-Dreamfactory-Session-Token", response.session_id, 'header'));
        }, function(response){
            document.getElementById("login-status").innerHTML = window.app.getErrorString(response);
        });
    };

    window.app.logout = function () {
        window.df.apis.user.logout(null, function (response) {
            document.getElementById("login-status").innerHTML = "Logged Out"
        }, function(response){
            document.getElementById("login-status").innerHTML = window.app.getErrorString(response);
        });
    };

```

what i want to do is, when i wass authentified to jump to my home page (dashboard.html) where i can run query and be authentificated.

my problem is when i go from login page to dashboard page i lost the authentification  
is there a way to pass session id from login.html to dashboard.html

or something else?

thanks in advance for your help

julien

---

<div class="post-metadata">

**Author:** ![jeffreystables](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.dreamfactory.com/jeffreystables/32/173_2.png) [@jeffreystables](https://community.dreamfactory.com/u/jeffreystables)\
**Post date:** [June 16, 2015, 3:05pm UTC](https://community.dreamfactory.com/t/how-to-authenticate-on-a-login-page-and-be-authenticated-on-application-page/1170/4 "2015-06-16T15:05:33Z")

</div>

Hi @jeebee, this sounds a lot like [your other thread here](https://community.dreamfactory.com/t/javascript-sdk-authentification-login-required-on-each-page/1071?u=jeffreystables). What makes this thread a separate issue instead of a continuation of the other thread?

---

<div class="post-metadata">

**Author:** ![jeffreystables](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.dreamfactory.com/jeffreystables/32/173_2.png) [@jeffreystables](https://community.dreamfactory.com/u/jeffreystables)\
**Post date:** [August 19, 2015, 4:45pm UTC](https://community.dreamfactory.com/t/how-to-authenticate-on-a-login-page-and-be-authenticated-on-application-page/1170/5 "2015-08-19T16:45:52Z")

</div>


