redirecting to localhost or 127.0.0.1

35 views
Skip to first unread message

Serge Bourgeois

unread,
Jun 14, 2013, 4:26:21 AM6/14/13
to web...@googlegroups.com

I tought that localhost and 127.0.0.1 were equivalent, but it looks not. I 'd like to understand the difference.

After auth authentification in a CAS, the system redirects correcty to localhost:8000/myapp/default/index.
Now, in a controller action, if I redirect again, for instance to 127.0.0.1:8000/myapp/myactionfile/myaction, then auth.user.id seems to be lost. And if myactionfile/myaction is decorated with @auth.requires_login(), the user has to identify again....

Thanks for any clarification on this subject.

Anthony

unread,
Jun 14, 2013, 6:51:06 AM6/14/13
to web...@googlegroups.com
The URL host name is part of request.client, which is used as the prefix for the session ID -- so switching from localhost to 127.0.0.1 causes a new session ID (and therefore session file) to be created.

Anthony

Serge Bourgeois

unread,
Jun 18, 2013, 4:29:13 AM6/18/13
to web...@googlegroups.com
Thanks Antony!


2013/6/14 Anthony <abas...@gmail.com>

--
 
---
You received this message because you are subscribed to a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/bS0znedc19U/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Reply all
Reply to author
Forward
0 new messages