hi, I'm trying to deploy supertoken in a ubuntu se...
# support-questions-legacy
y
hi, I'm trying to deploy supertoken in a ubuntu server with docker (session recipe), locally the session is created and work as expected but on the server the session is not created. Any idea on what might be wrong ?
r
When you say "on the server" session is not created, what do you mean?
@ysk1201
y
I meant eventhough the
await createNewSession(res, account.id)
is executed when login, the auth guard (verifySession) doesn't detect the session
r
can you enable frontend and backend debug logs and show the output?
there should be a troubhleshooting section in the guide
which will tell you how to enable those logs
y
for login, backend is using nestjs
Copy code
planner-back           | 2022-08-09T08:39:45.764Z com.supertokens {t: "2022-08-09T08:39:45.763Z", message: "middleware: Started", file: "/usr/src/app/node_modules/supertokens-node/lib/build/supertokens.js:158:26" sdkVer: "11.0.1"}
planner-back           |
planner-back           |
planner-back           | 2022-08-09T08:39:45.765Z com.supertokens {t: "2022-08-09T08:39:45.764Z", message: "middleware: requestRID is: undefined", file: "/usr/src/app/node_modules/supertokens-node/lib/build/supertokens.js:172:26" sdkVer: "11.0.1"}
planner-back           |
planner-back           | 2022-08-09T08:39:45.766Z com.supertokens {t: "2022-08-09T08:39:45.765Z", message: "middleware: Checking recipe ID for match: session", file: "/usr/src/app/node_modules/supertokens-node/lib/build/supertokens.js:220:34" sdkVer: "11.0.1"}
planner-back           | 2022-08-09T08:39:45.767Z com.supertokens {t: "2022-08-09T08:39:45.766Z", message: "middleware: Not handling because no recipe matched", file: "/usr/src/app/node_modules/supertokens-node/lib/build/supertokens.js:243:30" sdkVer: "11.0.1"}
planner-back           |
r
Can I see all the logs generated?
from process start
y
Copy code
bash
planner-back           | [Nest] 486  - 08/09/2022, 8:46:46 AM     LOG [NestFactory] Starting Nest application...
planner-back           | 2022-08-09T08:46:46.335Z com.supertokens {t: "2022-08-09T08:46:46.329Z", message: "Started SuperTokens with debug logging (supertokens.init called)", file: "/usr/src/app/node_modules/supertokens-node/lib/build/supertokens.js:270:18" sdkVer: "11.0.1"}
planner-back           |
planner-back           | 2022-08-09T08:46:46.337Z com.supertokens {t: "2022-08-09T08:46:46.337Z", message: "appInfo: {"appName":"planner","apiDomain":"http://163.172.4.169:3000","websiteDomain":"http://163.172.4.169:8084","apiBasePath":"/auth","websiteBasePath":"/"}", file: "/usr/src/app/node_modules/supertokens-node/lib/build/supertokens.js:271:18" sdkVer: "11.0.1"}
planner-back           |
planner-back           | 2022-08-09T08:46:46.339Z com.supertokens {t: "2022-08-09T08:46:46.338Z", message: "framework: express", file: "/usr/src/app/node_modules/supertokens-node/lib/build/supertokens.js:273:18" sdkVer: "11.0.1"}
planner-back           |
planner-back           | 2022-08-09T08:46:46.345Z com.supertokens {t: "2022-08-09T08:46:46.344Z", message: "session init: antiCsrf: NONE", file: "/usr/src/app/node_modules/supertokens-node/lib/build/recipe/session/recipe.js:164:18" sdkVer: "11.0.1"}
planner-back           |
planner-back           | 2022-08-09T08:46:46.346Z com.supertokens {t: "2022-08-09T08:46:46.346Z", message: "session init: cookieDomain: undefined", file: "/usr/src/app/node_modules/supertokens-node/lib/build/recipe/session/recipe.js:165:18" sdkVer: "11.0.1"}
planner-back           |
planner-back           | 2022-08-09T08:46:46.347Z com.supertokens {t: "2022-08-09T08:46:46.347Z", message: "session init: cookieSameSite: lax", file: "/usr/src/app/node_modules/supertokens-node/lib/build/recipe/session/recipe.js:166:18" sdkVer: "11.0.1"}
planner-back           |
planner-back           | 2022-08-09T08:46:46.348Z com.supertokens {t: "2022-08-09T08:46:46.348Z", message: "session init: cookieSecure: true", file: "/usr/src/app/node_modules/supertokens-node/lib/build/recipe/session/recipe.js:167:18" sdkVer: "11.0.1"}
planner-back           |
planner-back           | 2022-08-09T08:46:46.349Z com.supertokens {t: "2022-08-09T08:46:46.349Z", message: "session init: refreshTokenPath: /auth/session/refresh", file: "/usr/src/app/node_modules/supertokens-node/lib/build/recipe/session/recipe.js:168:18" sdkVer: "11.0.1"}
planner-back           |
planner-back           | 2022-08-09T08:46:46.350Z com.supertokens {t: "2022-08-09T08:46:46.350Z", message: "session init: sessionExpiredStatusCode: 401", file: "/usr/src/app/node_modules/supertokens-node/lib/build/recipe/session/recipe.js:171:18" sdkVer: "11.0.1"}
r
also, and when you call an API that is guarded with a session, what is the output?
y
r
right. So the frontend is not setting the cookies
are you using axios on the frontend?
y
yes
r
have you added supertokens interceptor to axios?
before making the API call
y
yes, and this is the log for front end
when I try to logout throught front
front generates the session but call
signOut from 'supertokens-auth-react/recipe/session'
doesn't remove the session
r
so just to confirm, you are adding the axios interceptor when calling the API? What are the logs on the frontend when you make the API call?
y
I've fixed it now thanks 😅 my mistake
r
oh hmm. WHat was the mistajke?
y
I was using cookieSecure: true and haven't setup https yet
r
ah i see. okay