![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
somesession
Advanced tools
Install with: npm install somesession
Beware somesession
would only pull all its depdencies if installed with its devDependencies
.
Considering production deployments, you would have to pick from these devDependencies
, those you would actually rely on.
Include them from whatever parent project or other piece of code you'ld be loading somesession
from.
// cassandra
const storeOptions = { driver: 'cassandra', database: 'sessions', username: 'casuser', password: 'caspass', host: '3.4.5.6', table: 'sessions' };
// mysql
const storeOptions = ({ driver: 'mysql', database: 'sessions', username: 'myuser', password: 'mypass', host: '2.3.4.5', table: 'sessions' };
// postgres
const storeOptions = ({ driver: 'postgres', database: 'sessions', username: 'pguser', password: 'pgpass', host: '1.2.3.4', table: 'sessions' };
// redis
const storeOptions = ({ driver: 'redis', database: 0, password: 'redisauthpass', host: '4.5.6.7' };
// defaults to sqlite
const storeOptions = ({ database: 'sessions.sqlite', path: './', table: 'sessions' };
const bodyParser = require('body-parser');
const express = require('express');
const http = require('http');
const session = require('express-session');
const store = require('somesession');
const app = express();
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: true }));
const storage = store(storeOptions, session);
app.use(session({
cookie: { secure: process.env.NODE_ENV === 'production' },
store: storage, secret: 'secr3t',
resave: false, saveUninitialized: false,
cookie: { maxAge: 86400 }
});
const httpServer = http.createServer(app);
app.get('/', (req, res) => {
if (req.session !== undefined && req.session.userid !== undefined && req.session.userid !== false) {
res.send(req.session.userid);
} else { res.send('unauthenticated'); }
});
app.post('/login', (req, res) => {
let userId = req.body.userId || false;
if (userId !== false) { req.session.userid = userId; }
res.redirect('/');
});
app.post('/logout', (req, res) => {
if (req.session !== undefined && req.session.userid !== undefined && req.session.userid !== false) {
req.session.userid = false;
req.session.destroy();
delete req.session;
}
res.redirect('/');
});
port = port || 8080;
httpServer.listen(port, '127.0.0.1', (err, res) => {
if (err) { reject(err); }
console.log(`mock server listening on 127.0.0.1:${port}`);
resolve(httpServer);
});
FAQs
Express.js sessions store abstraction library
We found that somesession demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.