How to implement a Rules Condition like [account:last-login] = never? Here is my contextual explanation:

I would like to redirect on a special page for first time after login. But registering system is using an email validation, so the path to the first login is "user/reset/uid/*", which brings the user to its profile page to save a password when the user clicks the one-time login button. This is fine and using a redirect after register of any kind is overriding it, which I don't want to. So I'm looking for a data comparison with the Rules module.

My question: How can I compare as a condition with rules [account:last-access] or [account:last-login] with something that would say never?

The rule would be this:


Rules Event : After updating account (because of the one-time login password change)
Rules Condition : [account:last-login] = never
Rules Action : redirect toward my special welcome page


These are the modules used:


rules
reference with user reference sub-module
ajax register (which usefully rewrite login to home)
It looks that what you're trying to do implement (= do a data comparison with "never") is not an obvious thing to do. Therefor, you may want to go for a plan-b that, for sure, will implement what you're trying to achieve, i.e. "... redirect on a special page for first time after login ..." (as in your question). Read on for more details.

Create a custom rule that looks like so (in Rules export format, use the Rules UI to import it in your own site):

{ "rules_redirect_new_users_to_special_page" : {
    "LABEL" : "Redirect new users to special page",
    "PLUGIN" : "reaction rule",
    "OWNER" : "rules",
    "REQUIRES" : [ "rules" ],
    "ON" : { "user_login" : [] },
    "IF" : [
      { "NOT user_has_role" : { "account" : [ "account" ], "roles" : { "value" : { "4" : "4" } } } }
    ],
    "DO" : [
      { "user_add_role" : { "account" : [ "account" ], "roles" : { "value" : { "4" : "4" } } } },
      { "redirect" : { "url" : "welcome\/newuser" } }
    ]
  }
}


Some details about this rule:


Rules Event: User has logged in.
Rules Condition: User does NOT (!!!) have a role with role id = "4".
Rules Action:


Grant User the role with role id = "4".
Perform a page redirect to relative path welcome/newuser.



So this rule checks if a user does not yet have some (designated) role with role id = "4" (adapt to whatever role id that fits your case, and make sure this role is NOT yet granted when activating a new user id). If that's the case then the user is granted that role, followed by a page redirect to relative path welcome/newuser (adapt to whatever path that fits your case). Obviously, next time a user performs a login again, the Rules Condition will no longer be TRUE, and no more redirect will be performed.

Pretty similar to "... redirect on a special page for first time after login ..." (as in your question), no?

Variation

What is explained before in this answer, does require some extra (dedicate) role. If you rather want to keep the number of roles in your site to a minimum, you could also use the Flag module (as an alternative for such extra role). Some more details about this variation:


Define a "global" flag to flag users
Replace the Rules Condition (to check for the dedicated role), by another one like "Check if the user is NOT flagged" (by the global flag).
Replace the Rules Action (to grant the dedicated role), by another one like "Flag this user flagged" (by the global flag).


Voilà ... use the solution you prefer, either one will do ...