Jump to content
  • 0
telepet

Possible to have automatic logout upon hitting "Submit" button?

Question

14 answers to this question

Recommended Posts

  • 0

Yes, if you are using a report type details datapage, you can set the following:

On your details page options settings, uncheck Navigate to next/previous record.

On your destination and email settings, set destination after record update dropdown to "Display A Message"

Uncheck enable HTML editor

Insert this redirect script in the message box:

<script>
window.location.href = "https://b5.caspio.com/folderlogout";
</script>

Just make sure your logout URL is set to the correct data center (example above is using b5).

This should automatically logout the user after they update.

Share this post


Link to post
Share on other sites
  • 0

Thanks @Carlson.  I'm using a Single Record Update data page, but will explore  building out a Details data page, like the one you mentioned above.   That said, I wonder on the feasibility of hiding the default "Update" button, then creating another button that is labeled "Submit", but have it be the logout link on the backend.  

II've hidden a search button before using this code in the header:

<style>
#searchID 
{
display:none;
}
</style>

..and so far I seem to be able to hide the Submit button by replacing #searchID with #Mod0EditRecord.  Now I think I need to find out how to make a button that both submits and logs out the user...

I'll update this thread once I've explored a bit....  Thanks again!

Share this post


Link to post
Share on other sites
  • 0

Thanks @MayMusic for the information.  I've since created a Details datapage that summarize the user input and has two buttons-- one that allows them to go back to the  Sincle Record Update page, and another button (labled "Confirm Submission") that actually logs out the user.  

Depending how this solution works in real life, I may end up using your much simpler solution.  Thanks again.

Share this post


Link to post
Share on other sites
  • 0
21 hours ago, telepet said:

Thanks @MayMusic for the information.  I've since created a Details datapage that summarize the user input and has two buttons-- one that allows them to go back to the  Sincle Record Update page, and another button (labled "Confirm Submission") that actually logs out the user.  

Depending how this solution works in real life, I may end up using your much simpler solution.  Thanks again.

Hi Telepet,

All suggestions will work, but to put a little bit of spice. You can use time delay before logging out automatically.

<script>
setTimeout(function () {
window.location.href = "https://b5.caspio.com/folderlogout";
}, 3000);
</script>

Try to have this code in your destination after record submit, just right under the display message. Please make sure you uncheck the "Enable HTML editor" before placing the code.

-Franchiser-

Share this post


Link to post
Share on other sites
  • 1

 

25 minutes ago, telepet said:

Thanks @Franchiser.  I'm wondering-- can you explain why it necessary to uncheck the "Enable HTLM editor" checkbox?  I've experimented with having it checked and things still seems to work ok.  

@telepet Some users may find enabling the HTML Editor to be a hassle when placing a code such as javascript or css. You need to click the source icon every time once the said code will be used if not, the code will display in a plain text.

-Franchiser-

Share this post


Link to post
Share on other sites
  • 0
On 1/16/2018 at 12:48 PM, Franchiser said:

Hi Telepet,

All suggestions will work, but to put a little bit of spice. You can use time delay before logging out automatically.

<script>
setTimeout(function () {
window.location.href = "https://b5.caspio.com/folderlogout";
}, 3000);
</script>

Try to have this code in your destination after record submit, just right under the display message. Please make sure you uncheck the "Enable HTML editor" before placing the code.

-Franchiser-

Thank you for this question and the answers because this is what I'm looking for, however, I'm trying to apply this to a Form instead and it's not quite working. 

Let me explain...

1. Authentication Page: User goes to a web page in which they must "authenticate" a code.  This is a Caspio Embedded data page with Authentication.
2. Redirected based on Code: Depending on the code they are redirected to a specific page, which is actually a Form. (So at this point, they are logged into Authentication).
3. Enrollment Form: User completes the form (an embedded Caspio form).
4. Submit: Once they hit Submit, there is a Display Message and an is Email sent.

I tried the code above and it does redirect, but bypasses the Authentication Page.  So they are never "logged out".  I need it to log out so they can enter a new code.  Unfortunately I can only set the automatic logoff to a minimum of 15 minutes.

Any suggestions would be greatly appreciated.

Thank you,

Kim

Share this post


Link to post
Share on other sites
  • 0

I figured out my issue and was able to use the code to automatically log the user out.  Now my only issue is...

  • If the user enters a code that redirects them to a completely different "external site" and they return back to the "Authentication Pge" in less than the 15 minute automatic logoff time limit, it redirects them back to that "external site".

So my issue is not 100% resolved.

Edited by kimburlyz
Revised response on resolution.

Share this post


Link to post
Share on other sites
  • 0

If you have updated your DataPages to use the subdomain for your account in the deploy code, the logout link now uses the account subdomain for your  account.

Rather than

b5.caspio.com/folderlogout

try

******.caspio.com/folderlogout

where ****** is your 

 

Also, see: https://howto.caspio.com/deployment/caspio-site-vs-account-subdomain-deployment/

 

Hope this helps

Share this post


Link to post
Share on other sites
  • 0

Thanks Chad! That is exactly what I did and it resolved it...however.  If the user enters a code that redirects them to a completely different "external site" and they return back to the "Authentication Pge" in less than the 15 minute automatic logoff time limit, it redirects them back to that "external site".

So my issue is not 100% resolved.

 

Share this post


Link to post
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.

Guest
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.

Loading...

×
×
  • Create New...