PhotoPost Community

PhotoPost Community (http://www.photopost.com/forum/)
-   ReviewPost How do I...? (http://www.photopost.com/forum/reviewpost-how-do-i/)
-   -   Cookie issue- forum users logged out (http://www.photopost.com/forum/reviewpost-how-do-i/144406-cookie-issue-forum-users-logged-out.html)

MoMan2 November 2nd, 2010 11:11 AM

Cookie issue- forum users logged out
 
On all my reviewpost installations, when a user uses a non-persistent cookie (i.e the user didn't check the "remember me" box when logging in) and tries to access the item listings (showcat), he is logged out.

Also, when I try logging into the reviewpost admin panel, I am myself logged out of the forum.

Why ideas as to where the problem could be?
My cookie prefix is bb, path /, domain .pentaxforums.com
In vb, the path is the same, and the domain is blank

I tried making both domains blank, and both .pentaxforums.com, but neither helped.
RP currently installed at ./lensreviews
forums currently installed at ./forums

Any ideas as to what could be wrong?

Thanks for your help!

Chuck S November 2nd, 2010 12:44 PM

http://www.photopost.com/forum/photo...-problems.html

To my knowledge if you set your cookie as noted in the actual tutorial you should have no issues.

cookie path /

cookie prefix ?? whatever yours is

cookie domain .pentaxforums.com

That should fine if you have to login with reviewpost again then my suggestion would be to look at both cookies and see where the differences are because there should be no differences if both applications are set the same.

MoMan2 November 2nd, 2010 01:01 PM

I checked the cookie using during persistent log in, and there were no problems. However, for the regular cookie:

Before-
bblastvisit 1288720723
bblastactivity 0
vbet_sessionUsed 1
__utma 179007781.360412241.1288720724.1288720724.1288720724.1
__utmb 179007781.9.10.1288720724
__utmc 179007781
__utmz 179007781.1288720724.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none)
__qca P0-1042254700-1288720723800
bbsessionhash a9cc1d60e1e739cd5066fd30d0177c9b
vbseo_loggedin yes
vbulletin_collapse
bbreferrerid 0
bbuserid 0
bbpassword
bbthreadedmode
bbstyleid 0
bblanguageid 0

After opening another RP page:

bblastvisit 1288720723
bblastactivity 0
vbet_sessionUsed 1
__utma 179007781.360412241.1288720724.1288720724.1288720724.1
__utmb 179007781.12.10.1288720724
__utmc 179007781
__utmz 179007781.1288720724.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none)
__qca P0-1042254700-1288720723800
bbsessionhash 5e110205ffe955791a7fb35ff5e6df3b
vbulletin_collapse
bbreferrerid 0
bbuserid 0
bbpassword
bbthreadedmode
bbstyleid 0
bblanguageid 0

As you can see, the session hash changed. Is the new cookie being assigned by RP?

Chuck S November 2nd, 2010 05:15 PM

we should only reset a sessionhash if you login from reviewpost.

If you go to your reviewpost after logging in from vb what are the cookies.

I may need to see a url and test login to check out cookies. See we simply grab a userid from the session table if there is no vbuserid.

MoMan2 November 2nd, 2010 05:31 PM

You may try the testuser account, password is test.

Comprehensive Pentax Lens Listings - Pentax Lens Review Database

MoMan2 November 2nd, 2010 05:52 PM

I looked into vb3.php, as that's where the authenticate function is.

Commented the queries out here:

Code:

Content visible to verified customers only.
The problem was gone.

Any idea why, and possibly what change needs to be made for this not to reset the hash?

MoMan2 November 2nd, 2010 05:54 PM

Another update: it seems that just removing the SET lastactivity part does the trick. I will try to trace it.

MoMan2 November 2nd, 2010 06:04 PM

With the SET lastactivity part commented out, I did an export of location and lastactivity right after the update query:
'/lensreviews/index.php?cat=1,1288738844'
5 seconds later:
'/lensreviews/index.php?cat=1 1288738849'

Seems that vBulletin is internally handling lastactivity.

Furthermore, $julian is empty for some reason:

Code:

Content visible to verified customers only.
'false'

This might be a server issue, as time_nanosleep doesn't work in PHP, and I'm not on a windows box.

In any case, I am going to accept my fix. Let me know if anything is not kosher here.

Thanks!

Chuck S November 2nd, 2010 06:09 PM

why would $julian be empty?

Code:

Content visible to verified customers only.
what version of php are you using?

MoMan2 November 2nd, 2010 06:17 PM

5.2.14

Let me upload a quick test script to check this out.

MoMan2 November 2nd, 2010 06:26 PM

In reviewpost, julian is still false, even though all the variables from the localtime() call are populated:

Code:

Content visible to verified customers only.
1288710000
--
1288740093
--
Array ( [0] => 33 [1] => 21 [2] => 18 [3] => 2 [4] => 10 [5] => 110 [6] => 2 [7] => 305 [8] => 1 )

Code:

Content visible to verified customers only.
'30 25 18 2 11 110 2 305 1'false

Looks like a problem with the year?

Chuck S November 2nd, 2010 07:50 PM

Has to be something in your specific php setup as time(); should work just fine unless there is some php bug in your version.

You can use your alterations thats fine.

MoMan2 November 2nd, 2010 07:53 PM

Yes, I believe there might be some small problems in PHP- it's been upgraded / compiled / modified so many times that I'm sure some issue must exist somewhere.

In any case, thanks for your help! This will do until we upgrade to php 5.3/6.

Chuck S November 2nd, 2010 09:05 PM

Yeah mktime was the old way of doing time in PHP and in most PHP 5 that I know of time(); should work let me know what 5.3 does for you.

MoMan2 November 2nd, 2010 09:13 PM

It'll post an update once the upgrade is completed. Likely won't be for a while though, as I don't think there's a package for centos yet.

Chuck S November 2nd, 2010 09:22 PM

PHP: time - Manual

Yeah time simply should return the unix timestamp from EPOCH etc etc etc.


All times are GMT -5. The time now is 07:45 AM.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97