コード/API呼び出しでユーザーの_forum_sessionと_tを生成する方法、またはブラウザにログインせずに生成する方法は?

Can you back up and describe what problem having those cookies is going to solve?

What are you trying to accomplish? Are you trying to have Discourse authenticate against your app? Maybe look at DiscourseConnect - Official Single-Sign-On for Discourse (sso)?