def _shared_login(request):
 csession = request.session
 player = request.user
 sesslogin = csession.get('logged_in', None)
 if (csession.session_key is None):
  csession.save()
 elif player.is_authenticated():
  if (not sesslogin):
   csession['logged_in'] = player.id
 elif sesslogin:
  player = PlayerDB.objects.get(id=sesslogin)
  try:
   player = authenticate(autologin=player)
   login(request, player)
  except AttributeError:
   logger.log_trace()

def _shared_login ( request ) : csession = request . session player = request . user sesslogin = csession . get ( 'logged_in' , None ) if ( csession . session_key is None ) : csession . save ( ) elif player . is_authenticated ( ) : if ( not sesslogin ) : csession [ 'logged_in' ] = player . id elif sesslogin : player = PlayerDB . objects . get ( id = sesslogin ) try : player = authenticate ( autologin = player ) login ( request , player ) except AttributeError : logger . log_trace ( )
handle the shared login between website and webclient .