{"id":5332,"date":"2022-10-29T12:27:21","date_gmt":"2022-10-29T16:27:21","guid":{"rendered":"https:\/\/www.cloudsurph.com\/?p=5332"},"modified":"2022-11-06T14:25:57","modified_gmt":"2022-11-06T19:25:57","slug":"how-to-install-and-configure-the-session-package-for-adonisjs","status":"publish","type":"post","link":"https:\/\/www.cloudsurph.com\/how-to-install-and-configure-the-session-package-for-adonisjs\/","title":{"rendered":"AdonisJS: Installing and Configuring Session Package"},"content":{"rendered":"<p>In this article, we can try to Install and Configure the Session package, how to install and configure the Session package for AdonisJS, Config the Session package, and configure the Session package and Usage.<\/p>\n<h3>Session<\/h3>\n<p>Firstly, the support for sessions is provided by the <strong>@adonisjs\/session<\/strong> package. This Session package comes pre-configured with the web starter template.<\/p>\n<h6><em>However, installing and configuring the Session is also relatively straightforward.<\/em><\/h6>\n<p><strong>Install<\/strong><\/p>\n<pre class=\"prettyprint\">npm i @adonisjs\/session\r\n<\/pre>\n<p><strong><em>You can check our previous article:\u00a0<a href=\"https:\/\/www.cloudsurph.com\/adonisjs-rest-api-crud-setup\/\">AdonisJS: REST API simple CRUD Operation<\/a>. IF you want then buy a good, reliable, secure web\u00a0<a href=\"https:\/\/www.cloudsurph.com\/windows-vps-hosting\/\">hosting<\/a>\u00a0service \u00a0from here:\u00a0<a href=\"https:\/\/hosting.cloudsurph.com\/\">click here<\/a><\/em><\/strong><br \/>\n<strong>Configure<\/strong><\/p>\n<pre class=\"prettyprint\">node ace configure @adonisjs\/session\r\n\r\n# CREATE: config\/session.ts\r\n# UPDATE: .env { \"SESSION_DRIVER = cookie\" }\r\n# UPDATE: .adonisrc.json { providers += \"@adonisjs\/session\" }\r\n<\/pre>\n<p><strong>Validate environment variables<\/strong><\/p>\n<pre class=\"prettyprint\">\/**\r\n* Make sure to add the following validation rules to the\r\n* `env.ts` file to validate the environment variables.\r\n*\/\r\nexport default Env.rules({\r\n\/\/ ...existing rules\r\nSESSION_DRIVER: Env.schema.string(),\r\n})\r\n<\/pre>\n<h3>Session Configuration<\/h3>\n<p>So, you can configure the behavior of the session by tweaking the <strong>config\/session.ts<\/strong> file for your project. Following below is the default config file.<\/p>\n<pre class=\"prettyprint\">import { sessionConfig } from '@adonisjs\/session\/build\/config'\r\n\r\nexport default sessionConfig({\r\nenabled: true,\r\ndriver: Env.get('SESSION_DRIVER'),\r\ncookieName: 'adonis-session',\r\nclearWithBrowser: false,\r\nage: '2h',\r\ncookie: {}, \/\/ see the cookie driver\r\nfile: {}, \/\/ see the file driver\r\nredisConnection: 'local', \/\/ see the redis driver\r\n})\r\n<\/pre>\n<h3>Session Drivers<\/h3>\n<p>And the session package allows you to choose between one of the available drivers to save the session data on your own projects.<\/p>\n<p>So, you can configure the driver inside the <strong>config\/session.ts<\/strong> file and the driver property, in turn, relies on the <strong>SESSION_DRIVER<\/strong> environment variable.<\/p>\n<pre class=\"prettyprint\">{\r\ndriver: Env.get('SESSION_DRIVER'),\r\n}\r\n<\/pre>\n<h3>Cookie Driver<\/h3>\n<p>Hence the cookie driver also works great even when your application or project is behind a load balancer since it will no information is stored on the server.<\/p>\n<p>So, you can pinch the settings for the cookie driver inside the <strong>config\/session.ts<\/strong> file.<\/p>\n<pre class=\"prettyprint\">{\r\n\/*\r\n|---------------------------------------------------------------\r\n| Cookies config\r\n|---------------------------------------------------------------\r\n|\r\n| The cookie settings are used to set up the session id cookie\r\n| and also the driver will use the same values.\r\n|\r\n*\/\r\ncookie: {\r\npath: '\/',\r\nhttpOnly: true,\r\nsameSite: false,\r\n},\r\n}\r\n<\/pre>\n<h3>File driver<\/h3>\n<p>Therefore, the file driver stores the session data on the server filesystem and you can configure the storage location by updating the value of the <strong>file.location<\/strong> property inside the <strong>config\/session.ts<\/strong> file for your application or project.<\/p>\n<pre class=\"prettyprint\">{\r\nfile: {\r\nlocation: Application.tmp('sessions'),\r\n},\r\n}\r\n<\/pre>\n<h4>Redis<\/h4>\n<p>Now, the configuration for the <strong>redis<\/strong> driver references one of the pre-defined <strong>redis<\/strong> connections inside the <strong>config\/redis.ts<\/strong> file in your projects.<\/p>\n<h5><em><strong>You can purchase your\u00a0<a href=\"https:\/\/hosting.cloudsurph.com\/\">hosting from Cloudsurph.com<\/a>,\u00a0<a href=\"https:\/\/hosting.cloudsurph.com\/\">Cloudsurph hosting<\/a>\u00a0is a reliable hosting option for business and personal projects. We offer insight and help on system configuration issues and code errors or bugs<\/strong>.<\/em><\/h5>\n<pre class=\"prettyprint\">{\r\ndriver: 'redis',\r\nredisConnection: 'local',\r\n}\r\n<\/pre>\n<p>Next, you can define a connection named local inside the <strong>config\/redis.ts<\/strong> file to your project.<\/p>\n<pre class=\"prettyprint\">{\r\nconnections: {\r\nlocal: {\r\nhost: Env.get('REDIS_HOST'),\r\nport: Env.get('REDIS_PORT'),\r\npassword: Env.get('REDIS_PASSWORD', ''),\r\ndb: 0,\r\n}\r\n}\r\n}\r\n<\/pre>\n<h3>Read\/Write session values<\/h3>\n<p>So, you can interact with sessions by using the <strong>ctx.session<\/strong> property.<\/p>\n<pre class=\"prettyprint\">Route.get('\/', async ({ session }) =&gt; {\r\n\/\/ Read value\r\nconst cartTotal = session.get('cart_total')\r\n\r\n\/\/ Write value\r\nsession.put('cart_total', cartTotal + 10)\r\n})\r\n<\/pre>\n<p>After then, here read-only version of the session is also available inside the Edge templates and you can access it using the session global helper.<\/p>\n<pre class=\"prettyprint\">&lt;p&gt; Cart total: {{ session.get('cart_total', 0) }} &lt;\/p&gt;\r\n<\/pre>\n<h4>get<\/h4>\n<p>After, read the value for a given key from the session store. Because you can define a default value to return when the actual value is undefined or null.<\/p>\n<pre class=\"prettyprint\">session.get('cart_total')\r\nsession.get('cart_total', 0)\r\n<\/pre>\n<h4>put<\/h4>\n<p>Now, write a key-value pair to the session store for the value should be one of the <strong><a href=\"https:\/\/docs.adonisjs.com\/guides\/cookies#supported-data-types\">cookie-supported data types<\/a><\/strong>.<\/p>\n<pre class=\"prettyprint\">session.put('cart_total', 1900)\r\n<\/pre>\n<h4>all<\/h4>\n<p>Now, read everything from the session store and you Will always be an object of a key-value pair.<\/p>\n<pre class=\"prettyprint\">console.log(session.all())\r\n<\/pre>\n<h4>forget<\/h4>\n<p>Now remove the value for a given key from the session store.<\/p>\n<pre class=\"prettyprint\">\/\/ Remove\r\nsession.forget('cart_total')\r\n\r\nsession.get('cart_total') \/\/ undefined<strong>\u00a0<\/strong>\r\n<\/pre>\n<h4><strong>increment<\/strong><\/h4>\n<p>Now, Increment the value for a given key and Make sure the original value is always a number. The Calling <strong>increment<\/strong> on a non-numeric value will result in an exception.<\/p>\n<pre class=\"prettyprint\">session.increment('page_views')\r\n<\/pre>\n<h4>decrement<\/h4>\n<p>But, Decrement the value for a given key and Make sure the original value is always a number. The Calling <strong>decrement<\/strong> on a non-numeric value will result in an exception.<\/p>\n<pre class=\"prettyprint\">session.decrement('score')\r\n<\/pre>\n<h4>clear<\/h4>\n<p>This is Clear the session store to an empty state.<\/p>\n<h5><em><strong>You can purchase your\u00a0<a href=\"https:\/\/hosting.cloudsurph.com\/\">hosting from Cloudsurph.com<\/a>,\u00a0<a href=\"https:\/\/hosting.cloudsurph.com\/\">Cloudsurph hosting<\/a>\u00a0is a reliable hosting option for business and personal projects. We offer insight and help on system configuration issues and code errors or bugs<\/strong>.<\/em><\/h5>\n<p>session.clear()<\/p>\n<h3>Session id lifecycle<\/h3>\n<p>Firstly, AdonisJS creates an empty session store and assigns it to a unique and separate session id on the first HTTP request, also even if the request\/response lifecycle doesn&#8217;t interact with sessions.<\/p>\n<pre class=\"prettyprint\">console.log(session.sessionId)\r\n\r\nif (!session.initiated) {\r\nawait session.initiate(false)\r\n}\r\n\r\nif (!session.fresh) {\r\nsession.regenerate()\r\n}\r\n\r\nsession.regenerate()\r\n<\/pre>\n<h3>Session flash messages<\/h3>\n<p>Secondly, Flash messages are stored inside the session store and are only available for the next HTTP request. Here you can use them for passing messages between HTTP requests. Check the given example below:<\/p>\n<pre class=\"prettyprint\">Route.get('\/', async ({ session, response }) =&gt; {\r\nsession.flash('message', 'Hello world')\r\nresponse.redirect('\/see-message')\r\n})\r\n\r\nRoute.get('\/see-message', async ({ session }) =&gt; {\r\nreturn session.flashMessages.get('message')\r\n})\r\n<\/pre>\n<p>Here we can use some methods like flash, flashAll, flashOnly, flashExcept, reflash, reflashOnly, reflashExcept, and Accessing flash messages, we will discuss another article. Finally, if you need to know more about this topic then please go to the <a href=\"https:\/\/docs.adonisjs.com\/guides\/session\">AdonisJS main website<\/a>.<\/p>\n<p>If you enjoyed reading this article and have more questions please reach out to our\u00a0<a href=\"https:\/\/hosting.cloudsurph.com\/submitticket.php?step=2&amp;deptid=1\">support team<\/a>\u00a0via live chat or\u00a0<a href=\"mailto:support@cloudsurph.com\">email<\/a>\u00a0and we would be glad to help you. we provide server\u00a0<a href=\"https:\/\/hosting.cloudsurph.com\/\">hosting<\/a>\u00a0for all types of need and we can even get your\u00a0<a href=\"https:\/\/hosting.cloudsurph.com\/\">server<\/a>\u00a0up and running with the service of your choice.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this article, we can try to Install and Configure the Session package, how to install and configure the Session package for AdonisJS, Config the Session package, and configure the Session package and Usage. Session Firstly, the support for sessions is provided by the @adonisjs\/session package. This Session package comes pre-configured with the web starter [&hellip;]<\/p>\n","protected":false},"author":8,"featured_media":5333,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"","_et_pb_old_content":"","_et_gb_content_width":"","footnotes":""},"categories":[152,157,25,158,159,44,1,31],"tags":[54,47,105,103,48,113],"class_list":["post-5332","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-adonisjs","category-centos-7","category-web-hosting-virtualization","category-linux-basics","category-linux-server","category-kvm-xen","category-virtual-private-servers","category-web-hosting","tag-best-vps-hosting-server-maryland","tag-cheap-cloud-servers","tag-cheap-storage-server-hosting","tag-cheapest-vps","tag-dedicated-server-hosting-in-washington-d-c","tag-speed-test-vps"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to install and configure the Session package for AdonisJS<\/title>\n<meta name=\"description\" content=\"How to install and configure the Session package for AdonisJS, Installing and Configuring Session Package for AdonisJS\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.cloudsurph.com\/how-to-install-and-configure-the-session-package-for-adonisjs\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to install and configure the Session package for AdonisJS\" \/>\n<meta property=\"og:description\" content=\"How to install and configure the Session package for AdonisJS, Installing and Configuring Session Package for AdonisJS\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.cloudsurph.com\/how-to-install-and-configure-the-session-package-for-adonisjs\/\" \/>\n<meta property=\"og:site_name\" content=\"Cloudsurph Web Hosting Washington D.C.\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/CloudSurph\/\" \/>\n<meta property=\"article:published_time\" content=\"2022-10-29T16:27:21+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-11-06T19:25:57+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.cloudsurph.com\/wp-content\/uploads\/2022\/10\/Installing-and-Configuring-Session-package.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1264\" \/>\n\t<meta property=\"og:image:height\" content=\"760\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Rony\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@cloudsurph\" \/>\n<meta name=\"twitter:site\" content=\"@Cloud_Surph\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Rony\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/how-to-install-and-configure-the-session-package-for-adonisjs\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/how-to-install-and-configure-the-session-package-for-adonisjs\\\/\"},\"author\":{\"name\":\"Rony\",\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/#\\\/schema\\\/person\\\/ac9b4dd136d96e50d5f29c560191e7ed\"},\"headline\":\"AdonisJS: Installing and Configuring Session Package\",\"datePublished\":\"2022-10-29T16:27:21+00:00\",\"dateModified\":\"2022-11-06T19:25:57+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/how-to-install-and-configure-the-session-package-for-adonisjs\\\/\"},\"wordCount\":749,\"publisher\":{\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/how-to-install-and-configure-the-session-package-for-adonisjs\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.cloudsurph.com\\\/wp-content\\\/uploads\\\/2022\\\/10\\\/Installing-and-Configuring-Session-package.jpg\",\"keywords\":[\"Best VPS hosting server Maryland\",\"Cheap Cloud Servers\",\"Cheap Storage Server Hosting\",\"Cheapest VPS\",\"Dedicated Server Hosting in Washington D.C\",\"Speed test VPS\"],\"articleSection\":[\"AdonisJS\",\"CentOS 7\",\"Cloud Hosting\",\"Linux Basics\",\"Linux Server\",\"Virtualization\",\"VPS Servers\",\"Web Hosting\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/how-to-install-and-configure-the-session-package-for-adonisjs\\\/\",\"url\":\"https:\\\/\\\/www.cloudsurph.com\\\/how-to-install-and-configure-the-session-package-for-adonisjs\\\/\",\"name\":\"How to install and configure the Session package for AdonisJS\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/how-to-install-and-configure-the-session-package-for-adonisjs\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/how-to-install-and-configure-the-session-package-for-adonisjs\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.cloudsurph.com\\\/wp-content\\\/uploads\\\/2022\\\/10\\\/Installing-and-Configuring-Session-package.jpg\",\"datePublished\":\"2022-10-29T16:27:21+00:00\",\"dateModified\":\"2022-11-06T19:25:57+00:00\",\"description\":\"How to install and configure the Session package for AdonisJS, Installing and Configuring Session Package for AdonisJS\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/how-to-install-and-configure-the-session-package-for-adonisjs\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.cloudsurph.com\\\/how-to-install-and-configure-the-session-package-for-adonisjs\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/how-to-install-and-configure-the-session-package-for-adonisjs\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.cloudsurph.com\\\/wp-content\\\/uploads\\\/2022\\\/10\\\/Installing-and-Configuring-Session-package.jpg\",\"contentUrl\":\"https:\\\/\\\/www.cloudsurph.com\\\/wp-content\\\/uploads\\\/2022\\\/10\\\/Installing-and-Configuring-Session-package.jpg\",\"width\":1264,\"height\":760},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/how-to-install-and-configure-the-session-package-for-adonisjs\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.cloudsurph.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"AdonisJS: Installing and Configuring Session Package\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/#website\",\"url\":\"https:\\\/\\\/www.cloudsurph.com\\\/\",\"name\":\"Cloudsurph Web Hosting Washington D.C.\",\"description\":\"Dedicated Server Hosting\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.cloudsurph.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/#organization\",\"name\":\"CloudSurph Technology Solutions\",\"url\":\"https:\\\/\\\/www.cloudsurph.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.cloudsurph.com\\\/wp-content\\\/uploads\\\/2016\\\/04\\\/cloudsurph-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.cloudsurph.com\\\/wp-content\\\/uploads\\\/2016\\\/04\\\/cloudsurph-logo.png\",\"width\":2348,\"height\":1692,\"caption\":\"CloudSurph Technology Solutions\"},\"image\":{\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/CloudSurph\\\/\",\"https:\\\/\\\/x.com\\\/Cloud_Surph\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/#\\\/schema\\\/person\\\/ac9b4dd136d96e50d5f29c560191e7ed\",\"name\":\"Rony\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/40163fe1eb49d5eddd81954e8ad5122633e141df15b0733d07fbe4a156688ba5?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/40163fe1eb49d5eddd81954e8ad5122633e141df15b0733d07fbe4a156688ba5?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/40163fe1eb49d5eddd81954e8ad5122633e141df15b0733d07fbe4a156688ba5?s=96&d=mm&r=g\",\"caption\":\"Rony\"},\"sameAs\":[\"https:\\\/\\\/x.com\\\/cloudsurph\"],\"url\":\"https:\\\/\\\/www.cloudsurph.com\\\/author\\\/ron\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to install and configure the Session package for AdonisJS","description":"How to install and configure the Session package for AdonisJS, Installing and Configuring Session Package for AdonisJS","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.cloudsurph.com\/how-to-install-and-configure-the-session-package-for-adonisjs\/","og_locale":"en_US","og_type":"article","og_title":"How to install and configure the Session package for AdonisJS","og_description":"How to install and configure the Session package for AdonisJS, Installing and Configuring Session Package for AdonisJS","og_url":"https:\/\/www.cloudsurph.com\/how-to-install-and-configure-the-session-package-for-adonisjs\/","og_site_name":"Cloudsurph Web Hosting Washington D.C.","article_publisher":"https:\/\/www.facebook.com\/CloudSurph\/","article_published_time":"2022-10-29T16:27:21+00:00","article_modified_time":"2022-11-06T19:25:57+00:00","og_image":[{"width":1264,"height":760,"url":"https:\/\/www.cloudsurph.com\/wp-content\/uploads\/2022\/10\/Installing-and-Configuring-Session-package.jpg","type":"image\/jpeg"}],"author":"Rony","twitter_card":"summary_large_image","twitter_creator":"@cloudsurph","twitter_site":"@Cloud_Surph","twitter_misc":{"Written by":"Rony","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.cloudsurph.com\/how-to-install-and-configure-the-session-package-for-adonisjs\/#article","isPartOf":{"@id":"https:\/\/www.cloudsurph.com\/how-to-install-and-configure-the-session-package-for-adonisjs\/"},"author":{"name":"Rony","@id":"https:\/\/www.cloudsurph.com\/#\/schema\/person\/ac9b4dd136d96e50d5f29c560191e7ed"},"headline":"AdonisJS: Installing and Configuring Session Package","datePublished":"2022-10-29T16:27:21+00:00","dateModified":"2022-11-06T19:25:57+00:00","mainEntityOfPage":{"@id":"https:\/\/www.cloudsurph.com\/how-to-install-and-configure-the-session-package-for-adonisjs\/"},"wordCount":749,"publisher":{"@id":"https:\/\/www.cloudsurph.com\/#organization"},"image":{"@id":"https:\/\/www.cloudsurph.com\/how-to-install-and-configure-the-session-package-for-adonisjs\/#primaryimage"},"thumbnailUrl":"https:\/\/www.cloudsurph.com\/wp-content\/uploads\/2022\/10\/Installing-and-Configuring-Session-package.jpg","keywords":["Best VPS hosting server Maryland","Cheap Cloud Servers","Cheap Storage Server Hosting","Cheapest VPS","Dedicated Server Hosting in Washington D.C","Speed test VPS"],"articleSection":["AdonisJS","CentOS 7","Cloud Hosting","Linux Basics","Linux Server","Virtualization","VPS Servers","Web Hosting"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.cloudsurph.com\/how-to-install-and-configure-the-session-package-for-adonisjs\/","url":"https:\/\/www.cloudsurph.com\/how-to-install-and-configure-the-session-package-for-adonisjs\/","name":"How to install and configure the Session package for AdonisJS","isPartOf":{"@id":"https:\/\/www.cloudsurph.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.cloudsurph.com\/how-to-install-and-configure-the-session-package-for-adonisjs\/#primaryimage"},"image":{"@id":"https:\/\/www.cloudsurph.com\/how-to-install-and-configure-the-session-package-for-adonisjs\/#primaryimage"},"thumbnailUrl":"https:\/\/www.cloudsurph.com\/wp-content\/uploads\/2022\/10\/Installing-and-Configuring-Session-package.jpg","datePublished":"2022-10-29T16:27:21+00:00","dateModified":"2022-11-06T19:25:57+00:00","description":"How to install and configure the Session package for AdonisJS, Installing and Configuring Session Package for AdonisJS","breadcrumb":{"@id":"https:\/\/www.cloudsurph.com\/how-to-install-and-configure-the-session-package-for-adonisjs\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.cloudsurph.com\/how-to-install-and-configure-the-session-package-for-adonisjs\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.cloudsurph.com\/how-to-install-and-configure-the-session-package-for-adonisjs\/#primaryimage","url":"https:\/\/www.cloudsurph.com\/wp-content\/uploads\/2022\/10\/Installing-and-Configuring-Session-package.jpg","contentUrl":"https:\/\/www.cloudsurph.com\/wp-content\/uploads\/2022\/10\/Installing-and-Configuring-Session-package.jpg","width":1264,"height":760},{"@type":"BreadcrumbList","@id":"https:\/\/www.cloudsurph.com\/how-to-install-and-configure-the-session-package-for-adonisjs\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.cloudsurph.com\/"},{"@type":"ListItem","position":2,"name":"AdonisJS: Installing and Configuring Session Package"}]},{"@type":"WebSite","@id":"https:\/\/www.cloudsurph.com\/#website","url":"https:\/\/www.cloudsurph.com\/","name":"Cloudsurph Web Hosting Washington D.C.","description":"Dedicated Server Hosting","publisher":{"@id":"https:\/\/www.cloudsurph.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.cloudsurph.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.cloudsurph.com\/#organization","name":"CloudSurph Technology Solutions","url":"https:\/\/www.cloudsurph.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.cloudsurph.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.cloudsurph.com\/wp-content\/uploads\/2016\/04\/cloudsurph-logo.png","contentUrl":"https:\/\/www.cloudsurph.com\/wp-content\/uploads\/2016\/04\/cloudsurph-logo.png","width":2348,"height":1692,"caption":"CloudSurph Technology Solutions"},"image":{"@id":"https:\/\/www.cloudsurph.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/CloudSurph\/","https:\/\/x.com\/Cloud_Surph"]},{"@type":"Person","@id":"https:\/\/www.cloudsurph.com\/#\/schema\/person\/ac9b4dd136d96e50d5f29c560191e7ed","name":"Rony","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/40163fe1eb49d5eddd81954e8ad5122633e141df15b0733d07fbe4a156688ba5?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/40163fe1eb49d5eddd81954e8ad5122633e141df15b0733d07fbe4a156688ba5?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/40163fe1eb49d5eddd81954e8ad5122633e141df15b0733d07fbe4a156688ba5?s=96&d=mm&r=g","caption":"Rony"},"sameAs":["https:\/\/x.com\/cloudsurph"],"url":"https:\/\/www.cloudsurph.com\/author\/ron\/"}]}},"_links":{"self":[{"href":"https:\/\/www.cloudsurph.com\/wp-json\/wp\/v2\/posts\/5332","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.cloudsurph.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.cloudsurph.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.cloudsurph.com\/wp-json\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"https:\/\/www.cloudsurph.com\/wp-json\/wp\/v2\/comments?post=5332"}],"version-history":[{"count":3,"href":"https:\/\/www.cloudsurph.com\/wp-json\/wp\/v2\/posts\/5332\/revisions"}],"predecessor-version":[{"id":5336,"href":"https:\/\/www.cloudsurph.com\/wp-json\/wp\/v2\/posts\/5332\/revisions\/5336"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.cloudsurph.com\/wp-json\/wp\/v2\/media\/5333"}],"wp:attachment":[{"href":"https:\/\/www.cloudsurph.com\/wp-json\/wp\/v2\/media?parent=5332"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.cloudsurph.com\/wp-json\/wp\/v2\/categories?post=5332"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.cloudsurph.com\/wp-json\/wp\/v2\/tags?post=5332"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}