Code Monkey home page Code Monkey logo

Comments (5)

Shpaky avatar Shpaky commented on May 25, 2024

HI!
Did you solve the problem?

from chicagoboss.

mobilemindtec avatar mobilemindtec commented on May 25, 2024

Hi,

I had to use version 1.9 of erlang to work.

from chicagoboss.

Shpaky avatar Shpaky commented on May 25, 2024

Hi!
Please pay attention, CB of last version have 'cowboy' dependence '2.6.1':

https://github.com/ChicagoBoss/ChicagoBoss/blob/0.9-beta2/rebar.config#L32

Old versions of CB have 'cowboy' dependence '1.0.3':

https://github.com/ChicagoBoss/ChicagoBoss/blob/v0.9-beta1/rebar.config#L32

Maybe you form cookies use outside tools, for example 'mochiweb_cookies' and set their in headers of response?
In this case you should look to invokes chain:

https://github.com/ChicagoBoss/ChicagoBoss/blob/master/src/boss/boss_simple_bridge_handler.erl#L27
->
https://github.com/nitrogen/simple_bridge/blob/d4fc5d10716317bc0a21abab94d84965a620598d/src/sbw.erl#L506
->
https://github.com/nitrogen/simple_bridge/blob/d4fc5d10716317bc0a21abab94d84965a620598d/src/cowboy_bridge_modules/cowboy_simple_bridge.erl#L182
->
https://github.com/nitrogen/simple_bridge/blob/d4fc5d10716317bc0a21abab94d84965a620598d/src/cowboy_bridge_modules/cowboy_simple_bridge.erl#L231
->
https://github.com/nitrogen/simple_bridge/blob/d4fc5d10716317bc0a21abab94d84965a620598d/src/cowboy_bridge_modules/cowboy_simple_bridge.erl#L276
->
https://github.com/ninenines/cowboy/blob/master/src/cowboy_req.erl#L718

Since '2.0.0-pre.4' version, cowboy 'Req' instance transformed from list of tuples to maps.

ninenines/cowboy@2.0.0-pre.3...2.0.0-pre.4#diff-35690b7e376fd28ead17b68765249f6ff7223669751e55176342f592273dc161R569

from chicagoboss.

mobilemindtec avatar mobilemindtec commented on May 25, 2024

Hi,

No, I'm use only boss_session:set_session_data(SessionID, logged_user, User). boss_web_controller_handle_request uses mochiweb_cookies:cookie. This is the problem?

boss_web_controller_handle_request:add_session_to_headers

add_session_to_headers(Req, Headers, SessionID) ->
    SessionExpTime    = boss_session:get_session_exp_time(),
    CookieOptions    = [
                        {domain, boss_env:get_env(session_domain, undefined)},
                        {path, "/"},
                        {max_age, SessionExpTime},
                        {secure, boss_env:get_env(session_cookie_secure, false)},
                        {http_only, boss_env:get_env(session_cookie_http_only, true)}
                       ],
    SessionKey        = boss_session:get_session_key(),
    lists:merge(Headers, [mochiweb_cookies:cookie(SessionKey, SessionID, CookieOptions)]).




from chicagoboss.

mobilemindtec avatar mobilemindtec commented on May 25, 2024

boss add set-cookie in headers, but on new version of cowboy need set in Res#response.cookies. Right?

from chicagoboss.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.