| Author |
Topic Search Topic Options
|
SMR Group
Newbie
Joined: 05 June 2006
Status: Offline
Points: 31
|
Post Options
Thanks(0)
Quote Reply
Topic: Storing Users Sessions in Database Posted: 16 July 2006 at 3:10am |
boRg,
I've got users who visit from different machines during the day (work, then home) and they would like to keep track of their viewed topics, last visit etc. across different machines. IE. they log out at work at 12pm and when accessing via their home computer their last visit reflects that, rather than the last time they visited on that machine as it is now.
If DatabaseHeldSessions is set to True, will all that be covered, or just their current session state?
I'm not too bothered about the performance hit, the board isn't that busy, I'm using the MySQL version and there's nothing else running on the server.
Thanks.
|
 |
WebWiz-Bruce
Admin Group
Web Wiz Developer
Joined: 03 September 2001
Location: Bournemouth
Status: Offline
Points: 9844
|
Post Options
Thanks(0)
Quote Reply
Posted: 16 July 2006 at 12:10pm |
No the changes you mention wouldn't change this. In version 7.x it did do this, but when witting the new login system for version 8, I must have missed coding this part in. To get this to work place the following at line 176 of the file functions/functions_login.asp:-
'Read in the last login date/time for this user If isDate(rsCommon("Last_visit")) Then dtmLastVisitDate = CDate(rsCommon("Last_visit")) Call saveSessionItem("LV", internationalDateTime(dtmLastVisitDate)) End If |
You will also need to chnage line 94 of the same file to:-
strSQL = "SELECT " & strDbTable & "Author.Password, " & strDbTable & "Author.Salt, " & strDbTable & "Author.Username, " & strDbTable & "Author.Author_ID, " & strDbTable & "Author.User_code, " & strDbTable & "Author.Active, " & strDbTable & "Author.Login_attempt, " & strDbTable & "Author.Last_visit " & _ |
|
|
|
 |
SMR Group
Newbie
Joined: 05 June 2006
Status: Offline
Points: 31
|
Post Options
Thanks(0)
Quote Reply
Posted: 08 August 2006 at 2:37am |
boRg, thanks for the code snippet, I updated the pages as above a week or so ago and it seems to have done the trick for users who visit using different computers.
However, something seems to have significantly slowed the system down when new messages are posted and this is the only change I have made in the last few weeks. It takes a long time (many seconds) for the forum to respond when clicking the "Post Reply" button in either the quick reply form or the new_reply_form.asp page.
All the other operations such as searches and general navigation are really fast (I'm running the MySQL version), the board is quiet and the only thing running on the server, so it can't be a resources issue.
Any ideas?
|
 |
WebWiz-Bruce
Admin Group
Web Wiz Developer
Joined: 03 September 2001
Location: Bournemouth
Status: Offline
Points: 9844
|
Post Options
Thanks(0)
Quote Reply
Posted: 08 August 2006 at 10:47am |
|
This code I have given will not effect performance in the slightest when you post a reply, new post, etc. as the code doesn't run during these times.
Usually if you have a delay when posting replies, etc. it is usually an email problem with delays in connecting to the SMTP server to send email notifications.
To test this disable email notifications from the admin area and make a post, it it runs faster you know it is this that is at fault.
To make it run faster see if you can use a localhost SMTP server as this would eliminate any delays in connecting to the SMTP server across a network.
|
|
|
 |
SMR Group
Newbie
Joined: 05 June 2006
Status: Offline
Points: 31
|
Post Options
Thanks(0)
Quote Reply
Posted: 02 December 2006 at 2:34am |
|
boRg, I'm revisiting this topic because the changes in where user sessions are stored that I made back in August, might have had a negative impact on users of Firefox 2.0.
While IE functions as expected, Firefox 2.0 does not correctly store user visit information. The board does not accurately reflect the last time a user visited, all the date displays are wrong (they don't appear to be updated) and therefore the list of new messages and icons are all incorrect.
If it's not the session storage method, do you know what else it could be? I've asked people to clear their cookies and that helps, but only for the first visit. So if a user revisits a day later, the board says they visited a day ago, but if they then revisit after another day, the board says their last activity was two days ago.
FYI, I'm also seeing odd login behaviour with Firefox 2 here, sometimes I stay logged in between visits, sometimes I'm logged out. This board has also got my last visit information wrong at least once, but I can't consistently recreate that bug, although it may have something to do with browsing with tabs.
|
 |
WebWiz-Bruce
Admin Group
Web Wiz Developer
Joined: 03 September 2001
Location: Bournemouth
Status: Offline
Points: 9844
|
Post Options
Thanks(0)
Quote Reply
Posted: 02 December 2006 at 8:24am |
|
There is no difference in the way the last visit is stored between IE and Firefox, they use the same method. The last visit date is stored in the database under the users details.
I have used Firefox 2 as my default browser since beta versions at the end of September and never had any of the issues you have mentioned.
|
|
|
 |
tjodalv
Newbie
Joined: 03 May 2006
Location: Croatia
Status: Offline
Points: 26
|
Post Options
Thanks(0)
Quote Reply
Posted: 02 December 2006 at 9:36am |
|
I use FF 2.0 and I have the same issue. For example this forum (http://www.webwiz.net/bbs), when I login today, all forums are marked as read, but my last visit was 20 Nov 2006 at 12:04am, so that would mean that there is no new topic from 20 Nov till today ...
|
 |
WebWiz-Bruce
Admin Group
Web Wiz Developer
Joined: 03 September 2001
Location: Bournemouth
Status: Offline
Points: 9844
|
Post Options
Thanks(0)
Quote Reply
Posted: 02 December 2006 at 1:40pm |
|
Like I mentioned previously the browser being used makes no difference as the data is not stored in cookies it is stored server side so makes no difference what browser you are using.
|
|
|
 |