[22:29:23] tgr : Hi [22:29:40] hi smartyrad [22:30:33] still haven't gotten around to going through all the proposals, but working on it [22:30:33] tgr: I was implementing sessions as you suggested in microtask 4 . I used RequestContext::getMain()->getRequest()->getSession()->set( 'SimplerCaptcha:botdetected', 1); [22:30:58] that sounds about right [22:31:52] tgr: Sure thing, regarding proposals, I have completed my proposal locally and in the outreaxhy website, I have filled out my eligibility details. It will be completed by today hopefully [22:33:29] tgr: How should I check whether the session exists i,e, what is mediawiki equivalent for isset( $_SESSION[ "botdetected" ] )? [22:34:35] tgr: I tried using RequestContext::getMain()->getRequest()->getSession()->exists('botdetected') but then I get a server error [22:37:23] tgr: Hello sir , I'm a applicant in user contribution summary tool. [22:40:32] hi yasha [22:40:41] smartyrad: what is the error? [22:40:46] tgr: I've written the implementation details of my project in accordance with the proposed timeline. According to outreachy application, these details must be discussed with mentors first , before including there. So can I share it on google doc with you where you can review and comment ? [22:42:04] yasha: that works too, but it's probably easier if you just share it on phabricator [22:42:32] you can just put a "DRAFT" note on the top [22:43:06] ok sir [22:44:10] NOn-static method should not be called statically in ExtensionRegistry [22:45:00] smartyrad: ExtensionRegistry callbacks are static [22:45:31] so you should define the method as static [22:45:55] but you should not try to manipulate the session there [22:46:26] those callbacks run in the configuration initialization phase, session handling probably has not been set up yet [22:47:44] tgr: And I was planning to develop a tool which would fetch the highest viewed article of that user for a smallish wiki. Can I proceed with this, as soon as I'm with the outreachy application part? Will it be a good idea ? [22:47:49] if you really need to do config manipulation based on session state, you can use the BeforeInitialize hook instead; you shouldn't need it though [22:49:17] tgr: Oh I see. But defining the method as static still doesn't seem to solve the issue [22:49:45] tgr: I not get Fatal error: Uncaught Error: Call to a member function getIP() on null [22:51:08] *now [22:53:39] tgr: I do remember reading something like we cannot access sessions until the user logs in ( No clue whether that's true but I remember reading something like that a while back) [22:58:24] yasha: if you want to practice / do an extra microtask then that sounds like a reasonable one, yes [23:00:27] smartyrad: the way sessions typically work, the server creates the data in some backend data store, indexes it with some random number, sends that number to the browser as a cookie, and the browser then returns it on every request until instructed otherwise [23:01:08] so the data is there, you can access it any time if you have the index number (the session id), but normally you don't [23:02:22] being logged in is not really relevant, one use of sessions is to store the fact that the user is logged in, but it's not really related to how sessions workű [23:03:30] anyway as I said you are probably making that call too early, some of the objects involved in MediaWiki's session handling have not been created yet [23:04:03] tgr: okay ! :) I'm taking this up. [23:25:08] tgr: Sorry, I had got disconnected. I tried RequestContext::getMain()->getRequest()->getSession()->get('SimplerCaptcha:botdetected') as well. Doesn't seem to work either [23:44:40] smartyrad: did you try using a hook that's called later? [23:48:56] tgr: I'm not sure how to do that. Can you point me to some example please?