Mojo mobile app :: Keep session active forever?

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
8/13/2013 10:18:27 AM
Gravatar
Total Posts 49
TRIAD/Next Level Interactive

Mojo mobile app :: Keep session active forever?

Hi all ---

We're finishing the development of a mobile app which is basically just a mojoPortal website in an app wrapper.

The app requires users to login (via the mojo Sign In module)... but unfortunately, they seem to have to login EVERY time they open the app. We were hoping that we could allow an infinite session... very much like the mobile apps of Facebook, LinkedIn, etc.

I've looked into the 'forms timeout' value in web.config... but this doesn't seem to do the trick.

Is there any way to accomplish a never-ending session?

Thanks... any input is appreciated!

8/13/2013 11:21:28 AM
Gravatar
Total Posts 18439

Re: Mojo mobile app :: Keep session active forever?

Hi,

I would first make sure persistent sessions work with a desktop web browser.

If it works there and not in your app, then all that I can think is look into how to persist the cookie in your app from whatever web browser you are using within the app to load the site and make sure that cookie survives across sessions within your app. 

See also Controlling Browser Sessions

Hope that helps,

Joe

8/13/2013 2:38:17 PM
Gravatar
Total Posts 49
TRIAD/Next Level Interactive

Re: Mojo mobile app :: Keep session active forever?

Hi Joe... thanks for the quick response.

No... we have not been able to get this to work in a normal desktop browser. I've pasted two of our config lines below. Is there anything else that we need to address to get this working correctly?

 

<forms name=".mojochangeme" protection="All" timeout="50000000" path="/" cookieless="UseCookies" />
<add key="AllowPersistentLoginCookie" value="true" />

mojoPortal Version: 2.3.7.0 MSSQL
Operating System: Microsoft Windows NT 6.1.7601 Service Pack 1
ASP.NET Info: v2.0.50727 Running in Full Trust

 

8/13/2013 3:05:43 PM
Gravatar
Total Posts 18439

Re: Mojo mobile app :: Keep session active forever?

It works in the web browser for me.

You must also make sure "Allow Persistent Authentication Cookie?" is checked in Site Settings.

Then a "Remember Me" checkbox should appear on the login page. If checked it will set a persistent cookie that will survive closing the web browser, rebooting etc.

The persistent cookie will expire based on timeout property on the <forms element in Web.config.

Hope that helps,

Joe

8/13/2013 3:30:36 PM
Gravatar
Total Posts 49
TRIAD/Next Level Interactive

Re: Mojo mobile app :: Keep session active forever?

Makes sense. I'll double check our settings.

Is there any way we can force the Persistent Authentication Cookie by default without needing to have users check the "Remember Me" box?

8/16/2013 11:18:56 AM
Gravatar
Total Posts 49
TRIAD/Next Level Interactive

Re: Mojo mobile app :: Keep session active forever?

I double checked our settings and was finally able to get this to work in our mobile app... thanks for your help!

Now... is there any way that we can have this "Remember Me" feature enabled by default... without having to make users check the box? Something in the config perhaps? I can probably use javascript as a last resort...

Thanks again, Joe...

8/29/2013 3:56:40 PM
Gravatar
Total Posts 18439

Re: Mojo mobile app :: Keep session active forever?

Ok, to help you with your scenario, I just implemented a new web.config setting. If you put this in your user.config file, then after upgrading to the next release, the remember me checkbox will not be shown on the login page but it will function as if it was checked, ie a persistent cookie will be set.

<add key="ForcePersistentAuthCheckboxChecked" value="true"/>

So this will work after the next release, or if you make your own build from the source code repository it is available now.

Hope that helps,

Joe

You must sign in to post in the forums. This thread is closed to new posts.