The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Help with User Context and Session timeouts
I've been trying to write some ajax code that calls a php class to get user information. I can get the user id successfully by calling vB::getUserContext()->fetchUserId() as long as my session hasn't timed out.
Now, I understand that when the session times out, then the user's login expires and the user id will always return 0. My question becomes, what happens in the case where the user has "Remember Me" checked? Even with it checked, I still see user id 0 returned when the session times out. Is there something I need to do to generate a new session using the "Remember Me" credentials? Currently I have to log out and then log in again to get a new session that returns valid user data. Keep in mind, this is all done via ajax, so there is no page load to refresh the session (although I tried reloading the page and it didn't seem to fix the ajax problem even though it showed me as still logged in on the page itself). EDIT: So I just discovered that if I increase my session timeout from 15 minutes to 2 hours this problem goes away. I am always able to get a valid userid from the above call, long after the session would've timed out... So clearly I am not understanding something here. Anyone have any insight? EDIT2: I figured out that every 60 minutes the security token is replaced which updates the lastactivity so as long as the session timeout is greater than one hour it will never time out. Any help would be very much appreciated! And since I seem to put my posts in the wrong spot all the time, I apologize in advance if this is not the right place for this question. |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|