Closed (fixed)
Project:
IP Login
Version:
6.x-1.2
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
3 Jul 2009 at 05:58 UTC
Updated:
4 Feb 2011 at 19:58 UTC
Jump to comment: Most recent file
Hi there,
I notice that after I set up an IP login, when I go to www.mysite.com I'm not logged in. It's not until after I click a link, ie, another page loads after the front page, that i'm logged in.
Has this got something to do with caching? Is there anything I can do about this?
Cheers!
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | ip_login_hook_boot.patch | 6.57 KB | deekayen |
Comments
Comment #1
deekayen commentedI believe this might be related to issues with browser cookie implementation. The first cookie is sent at the start of the page request and the system hasn't yet processed the login status. It takes another page load for the system to recognize after the login because the client didn't have the cookie on the first page load to send.
Comment #2
deekayen commentedActually, it might have to do with the use of hook_init() instead of hook_boot()
http://api.drupal.org/api/function/hook_init/6
hook_init() doesn't run on cached pages, so if the first page you loaded was cached, it wouldn't even attempt to authenticate you. I'm sure it's just a missed update from 5.x to 6.x where hook_boot() was first introduced and the behavior of hook_init() changed.
Comment #3
deekayen commentedThis patch switches to hook_boot() and conforms to Coder analysis at the minor level.
Comment #4
tripper54 commentedHi there,
So is this just a matter of renaming the ip_login_init() function to ip_login_boot()?
I tried that and it seems the login function check doesn't get called at all.
I don't want to apply your patch as I'm already running a modified version of the module (see http://drupal.org/node/352102 ).
Comment #5
deekayen commentedI think it ought to be during boot, which means you should be able to rename the function, but I'm not sure if all the functions in the init version are available that early in the bootstrap (like ip_address()). I guess that's my fault for uploading a dirty patch - I should have split the Coder part out as a separate submission.
Comment #6
jim kirkpatrick commentedHi, I've included deekayen's suggestions into a new, more flexible version - please see #791410: Improved: now supports logging in as alternate user plus comma separated values, IP ranges and wildcards for more.
Comment #7
jim kirkpatrick commented