Opened 6 years ago

Closed 6 years ago

#1690 closed improve feature (fixed)

session timeout when a writing forum post

Reported by: mahouni Owned by:
Priority: major Milestone: unassigned
Component: BW Forum Keywords:
Cc:

Description

when writing a long post, a member gets logged out, due to session timeout. The member can't see it and thinks he is still logged in. By clicking the submit button the data will be lost.

Change History (16)

comment:1 Changed 6 years ago by mahouni

I tried something with an Ajax request, if the member is logged_out there won't be a submit button, but a message to copy paste the text and login again to post.

https://gitorious.org/~mahouni/bewelcome/mahouni-rox/commits/crapbug

Please test locally! Is this appropriately using an Ajax requests? Probably not an elegant way and it doesn’t solve the problem completely. But it might prevent losing the data in most cases when timed out.

Better (concrete!) solutions are very welcome.

Last edited 6 years ago by mahouni (previous) (diff)

comment:2 follow-up: Changed 6 years ago by crumbking

Would it be possible to check via submit if the user is still logged in. If not save the data. Forward to the login, re-login, go back and repost?

comment:3 in reply to: ↑ 2 Changed 6 years ago by mahouni

Replying to crumbking:

Would it be possible to check via submit if the user is still logged in. If not save the data. Forward to the login, re-login, go back and repost?


I don't know if it is possible inside the forums app. If there are POST args variables still transfered after the timed out submit, then you would have to catch them before the request processing gets in touch with myTravelbook's PPostHandler in the forums Controller. Or hack that post handling class to get the args when logged out.

Changing the editor or at least how it is implemented was another idea brought up in the BW forum thread. I don't know how much work that would be. (And if it would solve the problem..)

Last edited 6 years ago by mahouni (previous) (diff)

comment:4 Changed 6 years ago by crumbking

Maybe this could be an option: https://code.google.com/p/tinyautosave/

We should update the editor first thought...

comment:5 Changed 6 years ago by mahouni

that autosave patch looks interesting and easy to install if we update! let's test it out.

comment:6 Changed 6 years ago by planetcruiser

work-around: open www.bewelcome.org in a different tab, keep reloading or re-login there before submitting your forum post

the session timeout seems to be shorter since the server move, so i assume this is a php.ini setting. might be worth looking into increasing the timeout to something like 24 hours as a quickfix

comment:7 Changed 6 years ago by mahouni

meinhard: "open www.bewelcome.org in a different tab, keep reloading or re-login there before submitting your forum post"
It seems that the post is still lost at the moment when you have been logged out, even when you do a re-login in a different tab. The 24hrs could be a good temporary solution, if that's okay for the server load?

crumbking: "We should update the editor first thought.."
We would have to upgrade tinyMCE from 3.4.3 (release 2011-06-16) to 3.5.6 (released 2012-07-26). I tried it and it is still working. I'll have to test everything yet and have a look at the autosave plugin.

Has someone tested my experimental fix? It works and would avoid most cases where the data is lost, but it comes without warranty though.. The php request will test if a member is logged in and would do

echo "logged_in"

or

echo "logged_out"

and after that there is a stop:

exit(0)

comment:8 Changed 6 years ago by jsfan

I have now changed the PHP config to

; Document expires after n minutes.
; http://php.net/session.cache-expire
session.cache_expire = 1440

to implement Meinhard's workaround (so I believe).

I think the whole session handling sucks and would even recommend getting rid of PHP sessions altogether and handle sessions in ROX. I have never trusted PHP sessions and I believe there is plenty of people out there who don't.

EDIT: This clearly doesn't have the effect I had hoped for. Not sure what to try instead. :(

Last edited 6 years ago by jsfan (previous) (diff)

comment:9 Changed 6 years ago by jsfan

Ok, I think I got the wrong option.

I'm now trying

; After this number of seconds, stored data will be seen as 'garbage' and
; cleaned up by the garbage collection process.
; http://php.net/session.gc-maxlifetime
session.gc_maxlifetime = 86400

instead. :) Let's see if this is what we need. ;)

comment:10 Changed 6 years ago by mahouni

Hey, I was able to get the tinyautosave plugin running and will push that branch to gitorous later today.

comment:11 Changed 6 years ago by mahouni

Hoppla, I forgot to add the new files to the git branch. It should work now:
https://gitorious.org/~mahouni/bewelcome/mahouni-rox/commits/tinymce_upgrade

git remote add mahouni git://gitorious.org/~mahouni/bewelcome/mahouni-rox.git
git fetch mahouni
git checkout -b tinymce_upgrade # or maybe it will create a new branch anyway??
git pull mahouni tinymce_upgrade

Or test it on nunatakker.li/bewelcome
user: ieva
pw: Obatzda77

EDIT: fyi, in that branch there is another commit with the trim of the http_baseuri from #1673.

Last edited 6 years ago by mahouni (previous) (diff)

comment:12 Changed 6 years ago by TimLoal

  • Type changed from unknown to improve feature

comment:13 Changed 6 years ago by jsfan

  • Milestone Future deleted

Milestone Future deleted

comment:14 Changed 6 years ago by jsfan

  • Milestone set to unassigned

Where are we on this one?

comment:15 Changed 6 years ago by mahouni

At the moment we are using TinyMCE 3.5.4. Some bugs have been fixed since then, but I am not sure if the newer versions of TinyMCE will help those people who just copy and paste content from other sources, e.g. word documents.
There was a release of TinyMCE 3.5.7 this month and they also announced a new major Version 4, with massive changes (there is no release date yet).

https://gitorious.org/~mahouni/bewelcome/mahouni-rox/commits/tinymce_upgrade
The branch linked above can be tested. I will update that branch soon, but probably not before next BWRox release. At the moment it is still based on a BWRox version from end of August and uses TinyMCE 3.5.6. I added the autosave plugin from this source: https://code.google.com/p/tinyautosave/ and enabled browser spell checking.

Last edited 6 years ago by mahouni (previous) (diff)

comment:16 Changed 6 years ago by sitarane

  • Resolution set to fixed
  • Status changed from new to closed

Irrelevant issue now that we have "stay connected" checkbox on login.

Note: See TracTickets for help on using tickets.