Home arrow Forum SMF sessions
  Welcome, Guest. Please login or register.
Did you miss your activation email?
December 05, 2008, 12:35:34 PM
Home New Posts Search Calendar


Login with username, password and session length
+  Joomla Forum
|-+  Joomla Hacks
| |-+  Joomla-SMF Forum Support
| | |-+  Joomla-SMF 2.0.x (Moderators: -Wolverine, kai920)
| | | |-+  SMF sessions
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Go Down Print
Author Topic: SMF sessions  (Read 2187 times)
Mike
Joomla Newbie
*

Karma: +0/-1
Offline Offline

Posts: 15


View Profile
SMF sessions
« on: October 23, 2006, 08:54:59 PM »

The problem with bridging is that Joomla and SMF use different sessions, and the bridge does not  change this, so a user can get logged out of smf and still be logged into Joomla, which I'm sure we would rather avoid. The reason being is that SMF has a 15 minute session. I would rather not merely extend the session, because it doesn't really resolve the issue. The solution is simple, ensure that users tick the "remember me" box when logging in.

I would rather not have to put a message up declaring to members that there is a fault and they have to click it, I would rather change the code in loggin so that it by defualt remembers them. Unfortunately, my knowledge of php is limited.

I believe that this is changed in SMF by changing the LogInOut.php, around line 77 :

Code:
$context['page_title'] = $txt[34];
$context['default_username'] = &$_REQUEST['u'];
$context['default_password'] = '';
$context['never_expire'] = false;

I assume by setting the never_expire to true, it becomes defualt to remember the user? If not where can I change this.

Also, I would rather not display the option, so that users are forced to stay logged in. I am unsure where to remove the option. I am fairly sure it is just a case of changing an <input type:checkbox...> <input type:hidden...>, I just don't know where to do it.

Lastly, this should solve the problem in SMF stand alone, but will it transfer accross to the bridge version, or do I need to mod the bridged logins instead.

Has anyone thought of doing this? Or is it not even possible? Any help / advice would be much appreciated.
Logged
Brat
Developer
Joomla Pro
*****

Karma: +11/-0
Offline Offline

Posts: 52


View Profile
Re: SMF sessions
« Reply #1 on: October 25, 2006, 08:13:03 PM »

Quick question - did you ever try to manually set the session length for SMF in SMF's administration section?

Regards,
Brat.
Logged
Daniel Dimitrov
QA / Testers
Joomla Newbie
*****

Karma: +0/-0
Offline Offline

Posts: 36


View Profile
Re: SMF sessions
« Reply #2 on: October 28, 2006, 04:39:39 AM »

Hm, the last days I spent wondering how to make the session not to expire after 15 minutes.
Mike you are wrong. It is not SMF, but joomla that set the sesseion to 15 minutes(global config - 900sec by defaut). (perhaps it is also made from SMF)

I got a lot of user saying that the site is logging them out, when they log in through the forum and set the time to 1 hour. Yes I tried it today and really the site log you out after 15 minutes. I believe this box with 1hour, 1 day and forever must go off and there must stay forever (I'm not sure if it is helping).
Logged
-Wolverine
Moderator
Joomla Guru
*****

Karma: +376/-34
Offline Offline

Posts: 3393


Lead Developer


View Profile WWW
Re: SMF sessions
« Reply #3 on: October 28, 2006, 10:40:04 AM »

the problem is this.  Joomla uses a more advanced form of session that actually will retain your session for longer than 15 minutes if you are still active.  SMF does not check if you are active, it will immediately log you out after 15 minutes.

So here is the problem, in order to sync sessions we take whichever you logged in from and then sync it to the other.  So a login from Joomla would give you exactly 15 minutes in SMF.  Once SMF logs out the bridge detects any time Joomla is logged in but SMF isn't(and vice versa) and logs you out of both. 

My suggestion is a longer login session for joomla and make the corrresponding session length in SMF.   Or you can modify the login module to always remember me.  To do this it is better to find the login form in the template and find the remember me &lt;input&gt; tag.  Add checked="checked" to it and then it will always be chekmarked. so it would look something like
Code:
<input name="rememeber_me" id="remember_me" value="1" checked="checked" />

That is not exactly right but I think you get the point
Logged

Need help?  Check Here First!
Get the JSMF User Guide
SEARCH this forum.
p9939068
Joomla Expert
****

Karma: +18/-5
Offline Offline

Posts: 173


View Profile WWW
Re: SMF sessions
« Reply #4 on: October 30, 2006, 10:30:53 PM »

Is there a way to set smf to "always login" automatically, but not for joomla? so that joomla's session will be the one controlling smf's session entirely through the bridge.

To explain a little more: since joomla's session affect smf's session and vice versa, we can make smf's session a constant and just allow joomla's session to be the variable, so that smf is completely dependant on joomla; if joomla's session ends, so does smf. If user logout from joomla, so does smf. but smf itself, without the interference from joomla, will never logout.

I understand this will only truly work if and only logging in is disabled in SMF. This is what i did, and i believe most people do this too.

Rgds, Mike
Logged

-----
Owner of http://mike.simbunch.com
Creator of ParaInvite, AJAX Sandbox, AJAX SMF Polls, Profile URL etc..
Daniel Dimitrov
QA / Testers
Joomla Newbie
*****

Karma: +0/-0
Offline Offline

Posts: 36


View Profile
Re: SMF sessions
« Reply #5 on: October 31, 2006, 05:26:58 AM »

Sounds interesting.
So you advice us to disable the login through SMF?
Logged
p9939068
Joomla Expert
****

Karma: +18/-5
Offline Offline

Posts: 173


View Profile WWW
Re: SMF sessions
« Reply #6 on: October 31, 2006, 06:54:19 AM »

Sounds interesting.
So you advice us to disable the login through SMF?
Yeap. I editted my smf theme to not show the login and register button on the forums, and disable showing a login box on every forum page. So basically every session handling, login and logout features are done via joomla using joomla's better session handling. At the moment, what i do is set the default smf session timeout (this default cannot be changed by users since they have no control over smf login functions) to a very high number, but i think that's not good enough.
Logged

-----
Owner of http://mike.simbunch.com
Creator of ParaInvite, AJAX Sandbox, AJAX SMF Polls, Profile URL etc..
Pages: [1] Go Up Print 
« previous next »
Jump to:  



Login with username, password and session length

Powered by MySQL Powered by PHP Joomla Forum | Powered by SMF 1.1 RC1.
© 2001-2005, Lewis Media. All Rights Reserved.
Joomla Bridge by JoomlaHacks.com
Valid XHTML 1.0! Valid CSS!

Joomla Hacks is a Joomla Components, Joomla Modules, Joomla Templates, & Joomla Mambots resource portal. None of the text or images in this public website may be copied without the expressed written consent of the authors. Copyright 2005 by JoomlaHacks.com. Powered by Joomla. All rights reserved.
Terms of Use
Joomla Hacks



Joomla Hacks
German Lang French Lang Italian Lang Spanish Lang Japanese Lang Chinese Lang
Search Contact About Advertise Blogs Topsites Submit News Register Login