Jump to content
  • 0

Redirect if User not logged in




I have a HTML datapage acting as a stand alone login screen. When a user logs in, they are diverted to our online system.

If a user goes directly to the online system without going via the HTML data page (and thus not being logged in), I would like to automatically direct them to the HTML data page.

How can I do this?

Many thanks for any help.

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

These are the pages you need to have:

- A standalone login page (let's call it "login.htm")

- A landing page after successful login (let’s call it “mypage.htm”)

Step 1.

- Create an authentication folder. Open the authentication wizard and add a Header/Footer to configure fields screen

Put at the header

Step 2.

Also Attach the following script to the footer of the login form

var cb_login_page="login.htm";

if(!document.getElementById('cb_login_box') && document.getElementById('cb_login_module')){

window.location= cb_login_page;

} else {

document.getElementById("cb_login_module").style.display = "" ;


Step 3.

Create an custom HTML page inside the authentication folder. Attach the following script.

var landing_page = ‘mypage.htm’; // it could be relative or full path


Step 4.

- At the standalone login page “login.htm”. Wrap the Caspio Deploy code of custom HTML page with a div

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...