# Automatic Login

If you wish to automatically login visitors to WebFileShare without asking them to fill in the login form, there are two ways:

## Using a custom link

http://<span dir="ltryle=" lang="style=" xml:lang="style=">YOUR-SITE.COM/WebFileShare</span>/?page=login&amp;action=login&amp;nonajax=1&amp;username=<span dir="ltryle=" lang="style=" xml:lang="style=">USERNAME</span>&amp;password=<span dir="ltryle=" lang="style=" xml:lang="style=">PASSWORD</span>

## Set the session programmatically

Redirect users to a PHP script like this:

<div id="bkmrk-%3C%3Fphp-%2F%2Fstart-webfil"><div>```
<?php
//start WebFileShare session
<a href="http://php.net/session_name" rel="noopener" target="_blank">session_name</a>('WebFileShareSID');
<a href="http://php.net/session_start" rel="noopener" target="_blank">session_start</a>();
 
$username = "admin";
 
//set logged in username
$_SESSION[['WebFileShare']][['username']] = $username;
 
echo "You are now logged in as '".$username."'.";
<a href="http://php.net/exit" rel="noopener" target="_blank">exit</a>();
```

</div></div>Copy the above code inside a file named “autologin.php” and place it inside the Web File Share installation folder and then just access “[http://www.your-site.com/WebFileShare/autologin.php](http://www.your-site.com/filerun/autologin.php "http://www.your-site.com/filerun/autologin.php")”