V
V
vkrzt2014-02-21 12:25:31
PHP
vkrzt, 2014-02-21 12:25:31

How can Drupal automatically authorize a user on the site if he has a cookie from another resource?

Good afternoon,
Does anyone know how to organize automatic user authorization on the site if he has a cookie from another resource.
Something simple in the form: if there is a cookie, we browse the site as an authorized user, if not, then as a guest.
Thank you.

Answer the question

In order to leave comments, you need to log in

6 answer(s)
M
Mikhail Osher, 2014-02-21
@miraage

Yeah, of course...
Is this a big joke, or do you really not understand?

F
FanatPHP, 2014-02-21
@FanatPHP

Before asking a question, you must first try to "register a domain", and see what happens.
After that, google about cross-site authorization.
In short - without the participation of that site, nothing will work. You can, for example, show a picture from it, with a unique parameter. So the browser will send its cookie requesting this picture.
Next, that site should make a request to this one, passing authorization information for the owner of the cookie.
Read this manual only if you have a clear understanding of the difference between a browser and a server.

V
vkrzt, 2014-02-21
@vkrzt

Will a cookie be created on the "other" resource with the registered domain of the site on which it will be used? Or I really just don't get it...

A
andead, 2014-02-21
@andead

no way

V
vkrzt, 2014-02-21
@vkrzt

Thanks for the advice.
But what if we assume that both the drupal site and the site that creates the cookie are on the same domain. Are there ready-made solutions for drupal?

P
Pavel, 2014-03-27
@pantey

if on the same domain, then you can try to do .... Drupal has a jquery.cookie out of the box, to which you can set properties relative to the domain.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question