
Login Session
Pricing
Pay per usage
Go to Store

Login Session
Get localStorage, sessionStorage and cookies from logins for usage in other actors.
0.0 (0)
Pricing
Pay per usage
7
Total users
383
Monthly users
6
Runs succeeded
15%
Last modified
4 years ago
You can access the Login Session programmatically from your own applications by using the Apify API. You can also choose the language preference from below. To use the Apify API, you’ll need an Apify account and your API token, found in Integrations settings in Apify Console.
1import { ApifyClient } from 'apify-client';2
3// Initialize the ApifyClient with your Apify API token4// Replace the '<YOUR_API_TOKEN>' with your token5const client = new ApifyClient({6 token: '<YOUR_API_TOKEN>',7});8
9// Prepare Actor input10const input = {11 "userAgent": "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.122 Safari/537.36",12 "maxRequestRetries": 0,13 "sessionConfig": {14 "storageName": "login-sessions",15 "maxAgeSecs": 3600,16 "maxUsageCount": 100,17 "maxPoolSize": 10018 },19 "steps": [20 {21 "username": {22 "selector": "input#email"23 },24 "password": {25 "selector": "input#pass"26 },27 "submit": {28 "selector": "input[type=\"submit\"]"29 },30 "failed": {31 "selector": "[role=\"alert\"]"32 },33 "waitForMillis": 500034 }35 ],36 "cookieDomains": [],37 "gotoTimeout": 30,38 "proxyConfiguration": {39 "useApifyProxy": true40 },41 "extraUrlPatterns": []42};43
44// Run the Actor and wait for it to finish45const run = await client.actor("pocesar/login-session").call(input);46
47// Fetch and print Actor results from the run's dataset (if any)48console.log('Results from dataset');49console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);50const { items } = await client.dataset(run.defaultDatasetId).listItems();51items.forEach((item) => {52 console.dir(item);53});54
55// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs
Login Session API in JavaScript
The Apify API client for JavaScript is the official library that allows you to use Login Session API in JavaScript or TypeScript, providing convenience functions and automatic retries on errors.
Install the apify-client
$npm install apify-client
Other API clients include: