[hunchentoot-devel] Redirecting preserving the session?

Hans Hübner hans at huebner.org
Thu Jul 24 20:04:32 UTC 2008


Andrei,

Cookies are set in the browser by the Set-Cookie header, and the
redirect itself has no influence on what cookies the browser sends to
the server.  I would recommend that you set
HUNCHENTOOT:*HEADER-STREAM* to *STANDARD-OUTPUT* and observer when and
if the session cookie gets set and is sent back.  The session cookie
is set by Hunchentoot when START-SESSION is called.  Using the header
debug output, you should be able to trace what's going on and maybe
give us a more detailed description of what your problem is.

-Hans

On Thu, Jul 24, 2008 at 21:55, Andrei Stebakov <lispercat at gmail.com> wrote:
> I am redirecting to the same server. So you are saying that the cookie
> should be there, I'll try to access them.
> I was just trying to refer to the session but it was empty. I was just
> trying to keep session alive even between redirects just like I can keep it
> alive when requests from different urls come to the same server from a user.
> I wonder if it's possible for redirects.
>
>
> On Thu, Jul 24, 2008 at 3:34 PM, Hans Hübner <hans at huebner.org> wrote:
>>
>> Andrei,
>>
>> I am not sure I understand:  Are you redirecting the request to the
>> same web server, or to a different one?  If you redirecting to the
>> same server, any cookie you might have set before should be presented
>> by the browser to the new URL.  If you're redirecting to a different
>> server, you can't set cookies to be presented to that different
>> server.
>>
>> Please try to give us more information.
>>
>> -Hans
>>
>> On Thu, Jul 24, 2008 at 19:27, Andrei Stebakov <lispercat at gmail.com>
>> wrote:
>> > When I use redirect method it redirects to a new url and in the handler
>> > for
>> > the url I have no way of knowing the session of the url from where it
>> > was
>> > redirected.
>> > How can I send cookies along with redirecting to a new url?
>> >
>> >
>> > _______________________________________________
>> > tbnl-devel site list
>> > tbnl-devel at common-lisp.net
>> > http://common-lisp.net/mailman/listinfo/tbnl-devel
>> >
>> _______________________________________________
>> tbnl-devel site list
>> tbnl-devel at common-lisp.net
>> http://common-lisp.net/mailman/listinfo/tbnl-devel
>
>
> _______________________________________________
> tbnl-devel site list
> tbnl-devel at common-lisp.net
> http://common-lisp.net/mailman/listinfo/tbnl-devel
>



More information about the Tbnl-devel mailing list