# Curl / login\_engine /user\_engine

**URL:** <https://www.ruby-forum.com/t/curl-login-engine-user-engine/72650>\
**Category:** Rails\
**Created:** [October 18, 2006, 10:39am UTC](https://www.ruby-forum.com/t/curl-login-engine-user-engine/72650 "2006-10-18T10:39:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![joe](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/b9e5f3/32.png) [@joe](https://www.ruby-forum.com/u/joe)\
**Post date:** [October 18, 2006, 10:39am UTC](https://www.ruby-forum.com/t/curl-login-engine-user-engine/72650/1 "2006-10-18T10:39:41Z")

</div>

Anyone ever use curl with user\_engine before? Even though I say

curl -uuser:pass

it doesn’t seem to login.

---

<div class="post-metadata">

**Author:** ![joe](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/b9e5f3/32.png) [@joe](https://www.ruby-forum.com/u/joe)\
**Post date:** [October 18, 2006, 10:40am UTC](https://www.ruby-forum.com/t/curl-login-engine-user-engine/72650/2 "2006-10-18T10:40:36Z")

</div>

Presumably curl will use HTTP Authentication, whereas the login engine  
doesn’t support this…

On 10/13/06, Joe [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Anyone ever use curl with user\_engine before? Even though I say
> 
> curl -uuser:pass
> 
> it doesn’t seem to login.
> 
> >

–

- J \*  
~

---

<div class="post-metadata">

**Author:** ![joe](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/b9e5f3/32.png) [@joe](https://www.ruby-forum.com/u/joe)\
**Post date:** [October 18, 2006, 10:44am UTC](https://www.ruby-forum.com/t/curl-login-engine-user-engine/72650/3 "2006-10-18T10:44:05Z")

</div>

On Oct 13, 2006, at 3:17 AM, James A. wrote:

> > it doesn’t seem to login.  
> > If you browse to your site in a browser and log in, then inspect  
> > your cookie and copy the session id out of it you can use that in  
> > your curl command to get thru the auth.

curl [http://localhost:3000/foo/bar/12](http://localhost:3000/foo/bar/12)?  
session\_id=dkjfh;dfh;ef;kladf;adj;fjadlk;fjad;fhadjkshfakdshf # or  
whatever it is.

also I am not sure if its \_sessionid or sessions\_id. look at what the  
key is in the cookie and use that.

-Ezra

---

<div class="post-metadata">

**Author:** ![joe](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/b9e5f3/32.png) [@joe](https://www.ruby-forum.com/u/joe)\
**Post date:** [October 18, 2006, 10:44am UTC](https://www.ruby-forum.com/t/curl-login-engine-user-engine/72650/4 "2006-10-18T10:44:09Z")

</div>

That seemed to work for GET, but not for POST. I get a redirect from  
user\_engine when using

curl -i -X POST -d “\<xml\_data\>”  
http://?\_session\_id=01234567890

If I use the command above without the post and the xml data, I get  
back the GET data I am expecting. If it was a routing issue, I would  
expect the GET not to work.I also removed the -i, but no difference.

I’m using

## if request.post?

## end if request.get?

end

in the controller, request.get? works fine.

In the development.log file, when I do the GET, the session id  
displayed is the same as the param value

Session ID: ABC  
Parameters: {"\_session\_id"=\>“ABC”, “action”=\>…

but in the POST I see they are different:

Session ID: DEF  
Parameters: {"\_session\_id"=\>“ABC”, “action”=\>…

Where the session id DEF is different from the session that had worked  
previously.

Why is user engine generating a new session for POST?
