Issues with grails in AWS

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

Issues with grails in AWS

binary
I am having a strange behavior with my app hosted on EC2.

let's the app resolves on example.com and www.example.com
when I go to my login action on example.com/public/login and a fill up the form and submit it, it redirects me to www.example.com/public/login without logging me in. I can't figure it out if it is 100% of the times or not at the moment, but if I go to www.example.com/public/login and fill up the info and submit it works fine.
Do you have any idea what it may be causing that or what kind of debugging I should be doing ?

thank you.
Reply | Threaded
Open this post in threaded view
|

Re: Issues with grails in AWS

Owen Rubel
This doesn't sound like a problem with the app. The app needs a FQDN. 'example.com' is NOT a FQDN but an ALIAS. If you want to setup an alias, you need to handle that either in Tomcat, your proxy or elsewhere.

Owen Rubel
415-971-0976
[hidden email]


On Sat, May 10, 2014 at 5:53 PM, binary <[hidden email]> wrote:
I am having a strange behavior with my app hosted on EC2.

let's the app resolves on example.com and www.example.com
when I go to my login action on example.com/public/login and a fill up the
form and submit it, it redirects me to www.example.com/public/login without
logging me in. I can't figure it out if it is 100% of the times or not at
the moment, but if I go to www.example.com/public/login and fill up the info
and submit it works fine.
Do you have any idea what it may be causing that or what kind of debugging I
should be doing ?

thank you.



--
View this message in context: http://grails.1312388.n4.nabble.com/Issues-with-grails-in-AWS-tp4656792.html
Sent from the Grails - user mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Reply | Threaded
Open this post in threaded view
|

Re: Issues with grails in AWS

lucastex
In reply to this post by binary
Hum...

1 - Are your instance behind one ELB and your domain pointing to you ELB?
2 - If yes, how many instaces are behind your ELB?

[]s,

Lucas



On Sat, May 10, 2014 at 9:53 PM, binary <[hidden email]> wrote:
I am having a strange behavior with my app hosted on EC2.

let's the app resolves on example.com and www.example.com
when I go to my login action on example.com/public/login and a fill up the
form and submit it, it redirects me to www.example.com/public/login without
logging me in. I can't figure it out if it is 100% of the times or not at
the moment, but if I go to www.example.com/public/login and fill up the info
and submit it works fine.
Do you have any idea what it may be causing that or what kind of debugging I
should be doing ?

thank you.



--
View this message in context: http://grails.1312388.n4.nabble.com/Issues-with-grails-in-AWS-tp4656792.html
Sent from the Grails - user mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Reply | Threaded
Open this post in threaded view
|

Re: Issues with grails in AWS

binary
In reply to this post by Owen Rubel
my example.com and www.example.com are both set up as type A, www.example.com is an ALIAS for mylinksdb.com, how should I set that up like ?

thank you
Reply | Threaded
Open this post in threaded view
|

Re: Issues with grails in AWS

binary
In reply to this post by lucastex
1- Yes, route53 is pointing to my elastick beanstalk, but it does not redirect example.elastickbeanstalk.com , it resolve the domain fine.
2 - only 1.
Reply | Threaded
Open this post in threaded view
|

Re: Issues with grails in AWS

Andréas Kühne
Hi binary,

I think you are having a different issue. Your problem is that the session cookie is not set on www.example.com, when you login at example.com. You cannot set session cookies over domains, and because your login redirects to www.example.com, your session is not logged in. However, if you were to go to example.com, you should be logged in.

I really don't know how to fix that though, more than only using www.example.com for your sessions (i.e. redirecting example.com -> www.example.com).

Regards,

Andreás


2014-05-11 16:16 GMT+02:00 binary <[hidden email]>:
1- Yes, route53 is pointing to my elastick beanstalk, but it does not
redirect example.elastickbeanstalk.com , it resolve the domain fine.
2 - only 1.



--
View this message in context: http://grails.1312388.n4.nabble.com/Issues-with-grails-in-AWS-tp4656792p4656799.html
Sent from the Grails - user mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Reply | Threaded
Open this post in threaded view
|

Re: Issues with grails in AWS

binary
You hit the nail on the head. I just tested that, the session is set on example.com and not on www.example.com . I am curious if anybody else stumbled upon this problem. I had another app a few year ago running from a computer at home, and I did not have this issue.
I am curious if anybody here can help.
Reply | Threaded
Open this post in threaded view
|

Re: Issues with grails in AWS

Rafael Vargas Rosas
Are you using Tomcat? I had once that same problem.

You need to set sessionCookieDomain on your context.xml with ".yourdomain.com".


--
Rafael Vargas Rosas

> El 11/05/2014, a las 13:09, binary <[hidden email]> escribió:
>
> You hit the nail on the head. I just tested that, the session is set on
> example.com and not on www.example.com . I am curious if anybody else
> stumbled upon this problem. I had another app a few year ago running from a
> computer at home, and I did not have this issue.
> I am curious if anybody here can help.
>
>
>
> --
> View this message in context: http://grails.1312388.n4.nabble.com/Issues-with-grails-in-AWS-tp4656792p4656802.html
> Sent from the Grails - user mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: Issues with grails in AWS

Andréas Kühne
Hi,

Yeah that should probably solve the issue. If you somehow set the domain name that the cookie is set on, you should be set.

Regards,

Andréas


2014-05-11 21:12 GMT+02:00 Rafael Vargas Rosas <[hidden email]>:
Are you using Tomcat? I had once that same problem.

You need to set sessionCookieDomain on your context.xml with ".yourdomain.com".


--
Rafael Vargas Rosas

> El 11/05/2014, a las 13:09, binary <[hidden email]> escribió:
>
> You hit the nail on the head. I just tested that, the session is set on
> example.com and not on www.example.com . I am curious if anybody else
> stumbled upon this problem. I had another app a few year ago running from a
> computer at home, and I did not have this issue.
> I am curious if anybody here can help.
>
>
>
> --
> View this message in context: http://grails.1312388.n4.nabble.com/Issues-with-grails-in-AWS-tp4656792p4656802.html
> Sent from the Grails - user mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Reply | Threaded
Open this post in threaded view
|

Re: Issues with grails in AWS

Owen Rubel
In reply to this post by binary
Always remember the web was built to work with FQDN's and that aliases will always attempt to resolve.

Owen Rubel
415-971-0976
[hidden email]


On Sun, May 11, 2014 at 11:08 AM, binary <[hidden email]> wrote:
You hit the nail on the head. I just tested that, the session is set on
example.com and not on www.example.com . I am curious if anybody else
stumbled upon this problem. I had another app a few year ago running from a
computer at home, and I did not have this issue.
I am curious if anybody here can help.



--
View this message in context: http://grails.1312388.n4.nabble.com/Issues-with-grails-in-AWS-tp4656792p4656802.html
Sent from the Grails - user mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Reply | Threaded
Open this post in threaded view
|

Re: Issues with grails in AWS

binary
In reply to this post by Rafael Vargas Rosas
thank you so much and thank you all. Adding the setcookiedomain fixed the issue.
Reply | Threaded
Open this post in threaded view
|

Re: Issues with grails in AWS

lucastex
And don't forget to use session stickyness when having more than one ec2 behind your elb.
otherwise you'll get a similar problem of logging in in one instance and reaching the other in some future requests.





On Sun, May 11, 2014 at 7:46 PM, binary <[hidden email]> wrote:
thank you so much and thank you all. Adding the setcookiedomain fixed the
issue.



--
View this message in context: http://grails.1312388.n4.nabble.com/Issues-with-grails-in-AWS-tp4656792p4656809.html
Sent from the Grails - user mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email